Label within repeater losing text on postback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • supraracer
    New Member
    • Feb 2009
    • 1

    Label within repeater losing text on postback

    Can anyone show me an example of a solution to the problem described in this thread? How do I rebind a label in a repeater on a postback?



    (I don't seem to be able to post to that group or something).

    Thanks.
  • maffarazo
    New Member
    • Apr 2009
    • 7

    #2
    use findcontrol

    something like this:
    Code:
      protected void Button1_Click(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;
            TextBox idd = btn.Parent.FindControl("t") as TextBox;
            TextBox tb = btn.Parent.FindControl("TextBox1") as TextBox;
        }
    you have to set EnableEventVali dation="false" in the
    <%@ Page Language="C#" MasterPageFile= "~/MasterPage.mast er" ... %> that's in your main code

    Comment

    Working...