By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 993 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

Label within repeater losing text on postback

P: 1
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?

http://bytes.com/groups/net-asp/3270...text-post-back

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

Thanks.
Feb 19 '09 #1
Share this Question
Share on Google+
1 Reply


P: 7
use findcontrol

something like this:
Expand|Select|Wrap|Line Numbers
  1.   protected void Button1_Click(object sender, System.EventArgs e)
  2.     {
  3.         Button btn = sender as Button;
  4.         TextBox idd = btn.Parent.FindControl("t") as TextBox;
  5.         TextBox tb = btn.Parent.FindControl("TextBox1") as TextBox;
  6.     }
  7.  
you have to set EnableEventValidation="false" in the
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" ... %> that's in your main code
Apr 30 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.