如何在特定ID选择上自动填充文本框名称。 [英] How to auto fill the textbox name on particular id selection.

查看:404
本文介绍了如何在特定ID选择上自动填充文本框名称。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文本框中有一个ID,我想代表id,名称应该显示在另一个文本框下面。我创建了一个方法,但不知道在哪里调用它..

每当我选择id时,下面的文本框应自动填充该特定Id的名称。



请帮助我...

I have an Id in textbox and I want on behalf of id ,name should be displayed in an below another textbox.I have created an method but don't know where to call it..
Whenever I select the id,the below textbox should automatically be filled with an name of that particular Id.

Please Help me...

推荐答案

将您的ID字段设置为autopostback = true,然后在回发时调用该方法。
Set your ID field to have autopostback = true, then call the method on postback.


尝试如下



Try as below

<asp:textbox id="TextBox1" ontextchanged="TextBox1_TextChanged" autopostback="true" runat="server" ></asp:textbox>// ManagerTextbox





在CodeBehind:





In CodeBehind:

protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            TrusteeName(); // assuming that this method fetches the required Trusteename from Db
        }





希望这会有所帮助......



Hope this helps...


这篇关于如何在特定ID选择上自动填充文本框名称。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆