如何在转发器控件中查找后面的代码中的文本框数据 [英] how to find textbox data in code behind in from repeater control
问题描述
如何找到在转发器项目模板中单击的按钮并找到文本框的数据。
基本上此任务与作业有关。
转发器我必须绑定数据喜欢这个
HiHow to find which button was clicked in a repeater itemtemplate and find the data of textbox.
Basically this task related to jobs.
Repeater I have to bind data like this
<%# Eval("Title") %><%# Eval("Desription") %>
jobsdisplay.DataSource = page;
jobsdisplay.DataBind();
在页面加载中我使用linq查询进行绑定。在repater中我有一个linkbutton名称发送。当我单击链接按钮打开弹出窗口时。弹出2个文本框和一个发送按钮。这3个控件也在转发器中。当我在两个文本框中输入两封电子邮件然后单击发送按钮将作业发送到电子邮件时,我在两个文本框中输入。我的问题是我找到了使用命令参数的linkbutton。
In page load I have bind using linq query.In repater I have a linkbutton name send. When I click the link button to open popup.In popup 2 textboxes and one send button. These 3 controls also in repeater. when I entered two emails on two text boxes and then click send button to send the job to email, which I entered in two textboxes.My problem is I found the linkbutton using command argument.
CommandName="Email" CommandArgument='<%# Eval("Id")%>'
if (e.CommandName == "Email")
{
TextBox txtto = (TextBox)e.Item.FindControl("txtto");
Response.write(txtto.text);
}
我的问题是我手动输入了txtbox值我没有得到我在txtbox中输入的文本框数据。
请帮帮我。
谢谢。
My problem is i entered txtbox values manually I am not getting textbox data which I entered in txtbox.
Please help me.
Thank you.
推荐答案
foreach (RepeaterItem item in ReapeaterName.Items)
{
TextBox txt= (TextBox)item.FindControl("TextBox1");
string b = txt.Text;
Label2.Text += b + " . ";
}
这篇关于如何在转发器控件中查找后面的代码中的文本框数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!