如何在linkbuttom命令参数中获取文本框值 [英] how to get the textbox value in linkbuttom command argument

查看:73
本文介绍了如何在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

推荐答案

不,你应该只提供该属性中的命令名称。假设你想编辑 LinkBut​​ton 点击,所以 CommandName 可以是 编辑



ItemCommand 活动中,您将检查 CommandName 并执行相应的任务。



访问 TextBox 值出现在行上,你必须这样做...

No, you should only provide the Command Name in that property. Suppose you want to Edit the Row with that LinkButton click, so CommandName can be "Edit".

In ItemCommand Event, you will check the CommandName and do appropriate task.

To access the TextBox 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屋!

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