Click here to Skip to main content
15,905,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
plz tell me what i can do for this....and i have to set by default focus on first employee id textbox when page get load.
Posted
Comments
OriginalGriff 11-Mar-14 5:37am    
And?
What have you tried?
Where are you stuck?
ArunAmalraj 11-Mar-14 5:42am    
Use the txtEmployeeId_lostfocus event to fill other textbox values

To setfocus add txtEmployeeId.Focus(); in page load

use textchange event on the server side and get data for that employee id and fill it. keep autopostback true for the textbox of employee id.

ASP.NET
<asp:textbox id="txteid" runat="server" autopostback="true" ontextchange="txteid_ontextchange" xmlns:asp="#unknown"></asp:textbox>


C#
protected void txteid_ontextchange (object sender, EventArgs e)
{
if(txteid.text!="")
{
string Eid = txteid.text
//your logic goes here to get data based on eID;
}

}
 
Share this answer
 
Comments
Member 10584788 11-Mar-14 6:13am    
thanks a lot...........
Try this

XML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script type="text/javascript">
        var searchid = function () {
            __doPostBack('<%= TextBox1.ClientID %>', '');
        }
    </script>
</head>
<body>
    <form id="frm" runat="server">
    <asp:TextBox ID="TextBox1" onblur="searchid()" AutoPostBack="true" runat="server"></asp:TextBox>
    </form>
</body>
</html>


C#
protected void Page_Load(object sender, EventArgs e)
       {
           if (Page.IsPostBack)
           {
               string id = TextBox1.Text;
               // your code here
           }


       }
   }
 
Share this answer
 

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