473,382 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label2" Text="ee" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

Here is the markup of the UpdatePanel inside the GridView:
<asp:TemplateField>
<ItemTemplate>
<asp:UpdatePanel runat="server" UpdateMode="Conditional"
ChildrenAsTriggers="false">
<ContentTemplate>
<asp:ImageButton ID="ibSelect" ImageUrl="~/Images/ArrowR.gif"
OnCommand="ibSelect_Command" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>

Here is the code-behind methods being called by the markup above:
protected void ibSelect_Command(object sender, CommandEventArgs e)
{
string url = "<url>";
WebRequest request = WebRequest.Create( url +
e.CommandArgument.ToString() );
request.BeginGetResponse(new AsyncCallback(OnResponse), request);
}
protected void OnResponse(IAsyncResult ar)
{
WebRequest request = (WebRequest)ar.AsyncState;
WebResponse response = request.EndGetResponse(ar);
System.IO.Stream stream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
string line;
System.Text.StringBuilder html = new System.Text.StringBuilder(40);
while ((line = reader.ReadLine()) != null)
{
html.Append(line);
}
Label2.Text = html.ToString();
UpdatePanel1.Update(); <<---------- here the program stops
executing and I get the error
}

any suggestions?
Mar 8 '08 #1
0 2907

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
I'm trying out the March 06 CTP of Atlas. My user controls containing updatepanel's won't render on the containing page at design time (they work fine at run time!!). Eg simple user control like: ...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
0
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a ScriptManager and UpdatePanel as below <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> ...
5
by: rawatgaurav81 | last post by:
I had a question on updatepanel. I had a simple form where I had one update panel.It contains a tab container which contains 3 tabs.Now I had set auto-postback of this container to true.I am not...
7
by: Mel | last post by:
I have an update panel that has the UpdateMode set to "Conditional". When I call UpdatePanel1.Update() in the VB code it does not work in FireFox. It works just fine in Internet Explorer 6.0. Any...
0
by: Ilyas | last post by:
Hi all I have the following in my .aspx <asp:ScriptManager runat="server" ID="ScriptManager1" /> <asp:UpdatePanel runat="server" ID="UpdatePanel1"> <ContentTemplate> <asp:Label...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have a...
10
dj12345
by: dj12345 | last post by:
Hi, (Asp.net + Ajax) I am creating a page which will fetch data from server without postbak of a page.. I have 2 controls on this page TextBox and Lable. I have assigned TextBoxWatermark...
2
by: qwedster | last post by:
Folks! The following is a "Hello World" kind of code for ViewState. I just want to know how to retain the ViewState 1) while Page Refresh when using UpdatePanel and also 2) While I reverting back...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.