如何在linkbuttom命令参数中获取文本框值 [英] how to get the textbox value in linkbuttom command argument
本文介绍了如何在linkbuttom命令参数中获取文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我在linkbutton commandname事件中将文本框和链接按钮放在转发器中我想获取文本框值如何我能做什么
Hi,
Hi i placed textbox and linkbutton in a repetor in linkbutton commandname event i want to get the textbox value how can i do
推荐答案
不,你应该只提供该属性中的命令名称。假设你想编辑行LinkButton
点击,所以CommandName
可以是 编辑。
在ItemCommand
活动中,您将检查CommandName
并执行相应的任务。
访问TextBox
值出现在行上,你必须这样做...
No, you should only provide the Command Name in that property. Suppose you want to Edit the Row with thatLinkButton
click, soCommandName
can be "Edit".
InItemCommand
Event, you will check theCommandName
and do appropriate task.
To access theTextBox
value present on the Row, you have to do like below...
protected void yourRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
TextBox yourTextBox = (TextBox)e.Item.FindControl("yourTextBoxId");
}
这篇关于如何在linkbuttom命令参数中获取文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文