How do I convert the text in a TextBox to Upper Case, as I type?
In order to do this, as it’s typed, you must add a Javascript attribute to the Textbox.
In your Page_Load routine, assuming your text box’s ID is ‘TextBox1′:
TextBox1.attributes(“onKeyUp”)=”this.value=this.value.toUpperCase();”
Why isn’t my ExecuteNonQuery updating my database?
When editing/updating a database with OleDb – here are two things to make sure of:
1. Make sure the defining parameter (ie: Where uid=@uid) in the Where clause is actually getting populated
2. When using parameterized queries, OLEDB parameters are positional. Make sure the parameters are defined in the same order as they appear in the SQL update string.
How can I set focus on an ASP.Net TextBox Control when the page loads?
Two things:
1. Give your BODY Tag and ID and include ‘Runat=Server’
(like – -
2. In the Page_Load event:
if not Page.IsPostBack then
bdyMain.attributes(“onload”)=”document.form1.TextBox1.focus();”
end if
How can I set focus on an ASP.Net TextBox Control when the page loads?
Two things:
1. Give your BODY Tag and ID and include ‘Runat=Server’
(like – -
2. In the Page_Load event:
if not Page.IsPostBack then
bdyMain.attributes(“onload”)=”document.form1.TextBox1.focus();”
end if
How can I loop through either all or certain types of controls on a page?
You can loop through all or certain type of controls on ASP.NET Page using this code. Code will loop through also those controls that are contained in some other container that Form, Panel for example. Example of looping through all TextBoxes on Page.
[C#]
private void LoopTextBoxes (Control parent)
{
foreach (Control c in parent.Controls)
{
TextBox tb = c as TextBox;
if (tb != null)
//Do something with the TextBox
if (c.HasControls())
LoopTextBoxes(c);
}
}
And you can start the looping by calling:
LoopTextBoxes(Page);
visit main article,