Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

doPostBack then Set focus?

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
I have a textbox that onKeyUp it does a postback... but then I need it to reset the focus to that textbox.

This is what i've tried:
Code:
<script type="text/javascript">
        function updatePanelPostback() {
            __doPostBack("<%=upHiddenPostback.ClientID%>", "");
            $get("txtAssignee").focus();
        }
     </script>

The textbox is txtAssignee and it is within an updatepanel.

This is how I can the function:
Code:
<asp:TextBox ID="txtAssignee" runat="server" OnKeyUp="javascript:updatePanelPostback();"></asp:TextBox>

Any ideas?

- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top