Submiting a form from HeaderTemplate

Results 1 to 2 of 2

Thread: Submiting a form from HeaderTemplate

  1. #1
    Join Date
    Dec 1969

    Default Submiting a form from HeaderTemplate

    I try to submit a form using a linkbutton. The linkbutton is placed in the HeaderTemplate of a repeater. The only thing that happens when I click the linkbutton is that the page is being reloaded, but no data posted. If I put my Linkbuton above my repeater it works perfectly.... any ideas?<BR><BR>&#060;asp:linkbutton ID="LbtOrderNo" OnCommand="OrdersSearch" CommandName="sortOrder" CommandArgument="Filename" Runat="server"&#062;Order No&#060;/asp:linkbutton&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Submiting a form from HeaderTemplate

    It&#039;s all about naming containers. If you think about it, you can have two link buttons in the same page with the same id if one is in a repeater (or composite control, datagrid...). In fact, if the linkbutton was in the item template, you could have 50 or 100 in the same name. The trick is moving between these naming containers. To go into a naming container, use findcontrol, as in:<BR><BR>((TextBox)e.FindControl("txtMyField")). Text<BR><BR>where e might be a datagridcommandeventargs or something like that. To go up a naming container, use the Parent property.<BR><BR>Your page is probably posting back but you probably aren&#039;t looking for data in the right places.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts