[英]how to get the Linkbutton's text to string type in it's Click event
i am posting the question in gridview ... while posting, question will get converted from textbox text to linkbutton control in the gridview in the button click event 我在网格视图中发布问题...在发布时,问题将在按钮单击事件中从文本框文本转换为网格视图中的linkbutton控件
upto this i have got what i want but 到目前为止,我有我想要的,但是
i am not able to fetch the LinkButton text in string type to post again same question on top of its child page and view it's replies alone under the same page 我无法获取字符串类型的LinkButton文本以在其子页面顶部再次发布相同的问题,并且无法在同一页面下单独查看其答复
doing ASP.net C# 2.0 做ASP.net C#2.0
protected void QuestionLinkButton_Click(object sender, EventArgs e)
{
string LBQ = linkbutton.text;
}
protected void QuestionLinkButton_Click(object sender, EventArgs e)
{
LinkButton btn = sender as LinkButton;
string LBQ = btn.Text;
}
i used below code and got my result 我使用下面的代码,并得到了我的结果
protected void QuestionLinkButton_Click(object sender, EventArgs e)
{
Session["LBQ"] = (sender as LinkButton).Text;
Response.Redirect("Thread.aspx");
}
and 和
protected void Page_Load(object sender, EventArgs e)
{
string Ques = Convert.ToString(Session["LBQ"]);
Questionlabel.Text = Ques;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.