I can't seem to get this to work. I have a simple Login page with 2 textboxes. I've tried all of the normal methods, plus a few things I've seen in this forum. None of them are working. I am using ASP.NET 4, VS 2010 and the LATEST build of the Telerik Controls. My HTML for the page is listed below. I've tried "OnClientShow"...the Javascript fires, but the button never visually looks like it has focus and no error appears. I'm debugging with IE 8.
Help?
thanks
mark
Help?
thanks
mark
<P><body class="form" ><BR> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"><BR> <script type="text/javascript"><BR>// function OnClientShow(sender, eventArgs) <BR>// {<BR>// try <BR>// {</P> <P>// var textbox = document.getElementById("<%= txtUserName.ClientID %>");<BR>// //var textbox = document.getElementById("RadWindow1$C$txtUserName");<BR>// //for testing...<BR>// //alert(textbox.name);</P> <P>// if (textbox != null) {<BR>// //-----------------------------------------------------<BR>// //This Code is firing, but the UI doesn't reflect it...<BR>// //-----------------------------------------------------<BR>// textbox.focus();<BR>// //alert('Just Set Focus');<BR>// }<BR>// else {<BR>// alert('Could not set focus to Textbox...');<BR>// return;<BR>// }<BR>// }<BR>// catch (e) {<BR>// alert('Error setting focus: ' + e.Message);<BR>// return;<BR>// }<BR>// } <BR> <BR> </script><BR> </telerik:RadScriptBlock><BR> <form id="form1" runat="server" defaultfocus="txtUserName"><BR><telerik:RadScriptManager ID="RadScriptManager1" runat="server"><BR> </telerik:RadScriptManager><BR> <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" Behaviors="None" Skin="WebBlue" AutoSize="true" <BR> Title="Login to Creative Affairs!" VisibleStatusbar="False" ><BR> <ContentTemplate><BR> <table width="275px" border="0" align="center"><BR> <tr><BR> <td align="center"><BR> <table class="formLabel" width="275px" cellpadding="3"><BR> <tr><BR> <td align="right"><BR> <asp:Label ID="Label1" runat="server" Text="User Name:"></asp:Label><BR> </td><BR> <td align="left"><BR> <asp:TextBox ID="txtUserName" runat="server" Width="125px"></asp:TextBox><BR> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName"<BR> ErrorMessage="Required"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr><BR> <td align="right"><BR> <asp:Label ID="Label2" runat="server" Text="Password:"></asp:Label><BR> </td><BR> <td align="left"><BR> <asp:TextBox ID="txtPassword" runat="server" Width="125px" TextMode="Password"></asp:TextBox><BR> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword"<BR> ErrorMessage="Required"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr align="left"><BR> <td><BR> <BR> </td><BR> <td><BR> <table width="100%"><BR> <tr><BR> <td align="left" width="60%"><BR> <asp:CheckBox ID="chkRemember" TextAlign="right" Text="Remember Me" runat="server" /><BR> </td><BR> <td align="right"><BR> <asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" /><BR> </td><BR> </tr><BR> </table><BR> </td><BR> </tr><BR> <tr align="left"><BR> <td colspan="2"><BR> <asp:Label ID="lblError" runat="server" ForeColor="Red" Text=""></asp:Label><BR> </td><BR> </tr><BR> </table><BR> </td><BR> </tr><BR> </table><BR> </ContentTemplate><BR> <BR> </telerik:RadWindow><BR> <BR> </form><BR></body><BR></html><BR></P>