Ask a Question related to ASP.NET General, Design and Development.
-
Javier Ros #1
Control focus
Hi guys,
How to Focus a TextBox on page load?
I have this function:
public static void FocusControl(Page pagina, WebControl control)
{
StringBuilder sScript = new StringBuilder();
sScript.Append("<SCRIPT language=\"javascript\">");
sScript.Append(control.ID + ".SetFocus();");
sScript.Append("</SCRIPT>");
pagina.RegisterStartupScript("ForceDefaultToScript 2", sScript.ToString());
}
and use it on PageLoad:
TWebTools.FocusControl(this, myTextBox);
but I get a JavaScript Error:
"'MyTextBoxID' not defined"
thanks in advance
..Javier Ros Moreno.
Javier Ros Guest
-
Taking focus from a control
In my app, I have a DataGrid, and when a row is double-clicked, a new view is put up showing the data. I also add eventListeners to the stage for... -
Setting Focus in a User Control
I have an editable datagrid as part of a usercontrol. When I click the Edit button, I wish for focus to be set on the first control, a... -
How control which button has focus [ENTER]
Hello, I'm facing a problem with the behavior of the key while editing items in a datagrid. I would like to make sure that the cancel button is... -
focus/lost focus of custom control
Hi new to .NET and have a question. What I want to do if have a custome control (contains a table grid of text boxes) and multiple instances... -
Which control had focus before postback?
Hi, Is it possible to retrieve the control that had the focus when the page was posted back? Because the focus is lost when a postback occurs...



Reply With Quote

