本文介绍了一旦员工在eid文本框中输入其员工ID,我想在相应的文本框字段中显示员工的详细信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请告诉我我能为此做些什么......我必须在页面加载时默认设置第一个员工ID文本框。
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.
推荐答案
<asp:textbox id="txteid" runat="server" autopostback="true" ontextchange="txteid_ontextchange" xmlns:asp="#unknown"></asp:textbox>
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;
}
}
<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>
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
string id = TextBox1.Text;
// your code here
}
}
}
这篇关于一旦员工在eid文本框中输入其员工ID,我想在相应的文本框字段中显示员工的详细信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!