This is the code that I am tring to work with
<td style="WIDTH: 81px; HEIGHT: 27px" align="left">Defect:</td
<td style="WIDTH: 141px; HEIGHT: 27px">
<asp:textbox id="Defect" Runat="server" Width="304px"></asp:textbox></td>
Can anyone help me set the focus to this textbox.
Thanks.Use this JavaScript:
function SetFocusToControl(id) {
document.getElementById(id).focus();
}
In you code, just use the following code:
protected TextBox Defect;void Page_Load(object sender, EventArgs e) {
Page.RegisterStartUpScript("focusScript", String.Format("<script language=\"JavaScript\">SetFocusToControl('{0}');</script>", Defect.ClientID));
}
0 comments:
Post a Comment