First off, this is really more of an ASP.NET question than a C# language one
and probably would have been better placed in the ASP.NET newsgroup.
txtREID is in an ItemTemplate in your Repeater, and so the INamingContainer
hierachy mangles the names to make them unique. An easy way to see this in
action is to simply View Source on the page in your browser.
So the concept of treating this control, which can appear in the Repeater
more than one time, as if it were a static single control on the page simply
won't work.
What exactly is it that you are trying to accomplish?
-- Peter
Recursion: see Recursion
site:
http://www.eggheadcafe.com
unBlog:
http://petesbloggerama.blogspot.com
BlogMetaFinder:
http://www.blogmetafinder.com
"vn****@hotmail.com" wrote:
I'm trying to use
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
txtREID.Text = DataBinder.Eval(Container.DataItem,
"[ID]");
}
}
because I'm using the txtREID.Text within an Insert SQL statement.
But if I try to reference the txtREID within:
<asp:Repeater ID="RepeaterControl" runat="server"
DataSourceID="SqlDataSource3">
<ItemTemplate>
<asp:TextBox ID="txtREID" runat="server" Visible="true"
Text=<%# DataBinder.Eval(Container.DataItem, "[ID]") %>/>
</ItemTemplate>
</asp:Repeater >
I error out stating that the txtREID doesn't exist.