hello Imar Sir,
U have posted a reply regarding my question about cursor persistent that leads me to a diff. page. There was the following statement and code
Quote:
|
When using ASP.Net AJAX to perform a postback from within a textbox input control, I found that the textbox loses focus after the postback. To overcome this, I added the following code:
|
Code:
ScriptManager.GetCurrent(Me.Page).SetFocus(MyTextBox)
Quote:
|
However, upon setting focus back to the textbox, the cursor lands at the beginning of the text in the control. To solve this, just add the following JavaScript on the page or within window.setTimeout:
|
Code:
var textInput = $get('MyTextBox');
if (textInput.createTextRange)
{
var range = textInput.createTextRange();
range.moveStart('character', (textInput.value.length));
range.collapse();
range.select();
}
Now it was regarding about one simple text box but I tried it in my senariou that is actually suggested by you in your book, that recommends about user control. There is one page ContactForm.aspx and also the user control.
Now please tell me how I change the code accordingly and where that code goes?