Click here to Skip to main content
15,916,042 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have taken textbox on modalpopup, i have used this.TxtATQuantityATC.Focus(); Method to keep focus but it doesn't work ..plz tell me another solution
Posted
Comments
Satyendra Kumar(Analyst Programmer) 8-May-13 8:16am    
Hi,
You are using ajax call or full postback please update me so that I can understand your problem. If possible please explain your query in more words so that others can understand....
Member 9579525 8-May-13 8:39am    
i am using __doPostBack('<%= TxtATQuantity.ClientID %>', '') javascript function to fire textchanged event to display total price dynamically
jkirkerx 8-May-13 13:41pm    
If your firing a post back to the server, you probably need to use the server side code to put focus on that textbox in the onload or page.load event.

Any code in the Javascript after the postback will not apply after the postback, a postback is like a fresh clean page.

XML
Follow these links it may help you

<a href="http://csharpdotnetfreak.blogspot.com/2009/09/popup-update-refresh-parent-child.html">http://csharpdotnetfreak.blogspot.com/2009/09/popup-update-refresh-parent-child.html</a>[<a href="http://csharpdotnetfreak.blogspot.com/2009/09/popup-update-refresh-parent-child.html" target="_blank" title="New Window">^</a>]

<a href="http://wiki.asp.net/page.aspx/282/">http://wiki.asp.net/page.aspx/282/</a>[<a href="http://wiki.asp.net/page.aspx/282/" target="_blank" title="New Window">^</a>]
 
Share this answer
 
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
txtuid.Focus();
}


for more information about getting focus in texbox you can check given reference link

Focusing and Selecting the Text in ASP.NET TextBox Controls[^]


Default Focuswith Validation Errors with ASP.NET 2.0 [^]


<edit> Added the URL for the first link </edit>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900