Вопрос

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

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

doing 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 с атрибуция
Не связан с StackOverflow
scroll top