The Update method can only be called on UpdatePanel with ID 'UpdatePanel1' before Render.|

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    The Update method can only be called on UpdatePanel with ID 'UpdatePanel1' before Render.|

    hey

    asp.net 3.5

    I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one
    of its column is a templatefield which again contain a UpdatePanel and a
    button...

    The other UpdatePanel is located outside the GridView....

    when I click on the button in the GridView I get this error message:
    The Update method can only be called on UpdatePanel with ID 'UpdatePanel1'
    before Render.

    here is the markup of the UpdatePanel which is located outside GridView:
    <asp:UpdatePane l ID="UpdatePanel 1" runat="server" UpdateMode="Con ditional">
    <ContentTemplat e>
    <asp:Label ID="Label2" Text="ee" runat="server"> </asp:Label>
    </ContentTemplate >
    </asp:UpdatePanel >

    Here is the markup of the UpdatePanel inside the GridView:
    <asp:TemplateFi eld>
    <ItemTemplate >
    <asp:UpdatePane l runat="server" UpdateMode="Con ditional"
    ChildrenAsTrigg ers="false">
    <ContentTemplat e>
    <asp:ImageButto n ID="ibSelect" ImageUrl="~/Images/ArrowR.gif"
    OnCommand="ibSe lect_Command" runat="server" />
    </ContentTemplate >
    </asp:UpdatePanel >
    </ItemTemplate>
    </asp:TemplateFie ld>

    Here is the code-behind methods being called by the markup above:
    protected void ibSelect_Comman d(object sender, CommandEventArg s e)
    {
    string url = "<url>";
    WebRequest request = WebRequest.Crea te( url +
    e.CommandArgume nt.ToString() );
    request.BeginGe tResponse(new AsyncCallback(O nResponse), request);
    }


    protected void OnResponse(IAsy ncResult ar)
    {
    WebRequest request = (WebRequest)ar. AsyncState;
    WebResponse response = request.EndGetR esponse(ar);
    System.IO.Strea m stream = response.GetRes ponseStream();
    System.IO.Strea mReader reader = new System.IO.Strea mReader(stream) ;
    string line;
    System.Text.Str ingBuilder html = new System.Text.Str ingBuilder(40);
    while ((line = reader.ReadLine ()) != null)
    {
    html.Append(lin e);
    }
    Label2.Text = html.ToString() ;
    UpdatePanel1.Up date(); <<---------- here the program stops
    executing and I get the error
    }

    any suggestions?


Working...