Ajax Update panel with in user custom panel

HI i am trying to add Update panel in a custom Panel but when i Add the panel controls and then render the update panel to the page it gives error "page can not be null" error detail is give as under i am attaching the code too

Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

Source Error:

Line 137:            #endregion
Line 138:
Line 139:             tbl.RenderControl(writer);
Line 140:
Line 141:


Source Code

protected override void Render(HtmlTextWriter writer)


// Capture the default output of the Panel


StringWriter wrt = new System.IO.StringWriter();

HtmlTextWriter buffer = new HtmlTextWriter(wrt);


string panelOutput = wrt.ToString();

Table tbl = new Table();


new TableRow());


new TableCell());

tbl.Rows[0].Cells[0].Text = "";





UpdatePanel up1 = new UpdatePanel();

up1.ID =


up1.UpdateMode =



new TableRow());


new TableCell());

Table tbl2 = new Table();


new TableRow());


new TableCell());

tbl2.Rows[0].Cells[0].Text = panelOutput;










1/28/2007 6:57:14 PM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 56

Any solutions for this issue? I'm trying to render a programatically constructed UpdatePanel as the overridden Render() function for a custom control, and I'm getting this same error.


Any ideas? 

"Sometimes you eat the bar and sometimes... well, he eats you"

"Duuude you're being very un-duuuude"
3/19/2008 6:08:19 PM

 Did you ever find a solution to this issue?  I am coming across something similar with the accordion.

1/19/2009 4:07:51 PM

Similar Artilces:

AJAX update panel updating all panels!
Hey there, I have 2 updated panels on a page update panel1 and update panel2. One is triggerd by a list box and the other is triggered by an image button,, the only problem is although each trigger is assigned to their respective list boxes, whenever a trigger is activated it refreshes both update panels, which is not what I want.  This is my update panel refreshed by the image button   <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <TABLE id="Table6" style="WIDTH: 208px; HEIGHT: 248px" cellSpacing="1" cellPadding="1" width="208" border=...

ajax panel refreshing another ajax panel
Hi,I have a problem that my controls on one Ajax panel seems to be effected controls on another Ajax panel, that is displaying them.  I will be the first to admit; I am new to this and may have misunderstood the use of the panels.I have a web site http://bhx.innosked.com/Default.aspx?show=ITD  The top of the web site is a search panel.   The date label, calendar and calendar image is on one AJAX panel.  If you click on the calendar image, the calendar comes up fast. The problem arises if you do thisKey in MIA in the Destination field and...

AJAX Update Panel appears to also update Panel in other content area....
 I have to content areas, each with their own update panels.  I notice that whenever a partial page postaback is triggered in UpdatePanel2, a refresh is performed in UpdatePanel1.  The code does not use triggers to force the partial page postback.  The control in Panel2 is a textbox control that I assume by default causes the partial postback on a CR.  The control being refreshed in Panel1 is a DropDownList.In addition, I have found that during a partial page postback for Panel2, Panel1 controls are being enabled unless I explicitly disable them.Any ideas on why this...

AJAX: which is better more controls inside one update panel or few controls inside more update panels
hi in form that have many controls , gridview , formview, buttons, textboxes, etc. which is better, put them all in one update panel, or few controls in more update panels? i.e. gridview , formview, buttons, textboxes all in one update panel or gridview in update panel, formview in updat panel, buttons (that text needs to change based on some business rules) in update panel, etc? besides will tables and divs inside update panel affect AJAx performance?! Hi,    Putting too many controls in an update panel will certainly affect the performance. I have certainly faced it. ...

How do we customize Ajax calendar Control and Ajax Tabbed Panel?
Hi FriendsAm confronting with a very trivial issue of customizing the tabbed panel and the Calendar controls of the Ajax control toolkit. Can anyone give me some ideas of how to customize these as I tried changing the CSS and setting the new css, but all in vain.can anyone help me out with this issue?Thanks Karthik MuthuswamyProgrammer AnalystChennai I tried my own idea. Thanks everyone.Karthik MuthuswamyProgrammer AnalystChennai...

Ajax Update Panel not Updating
I have asp page with one update panel. Inside update panel there is a button and a label control. when I click button and try to updatel label.text="something" it works. But what I am trying to do is on button click I create FileSystemWatcher object and register its changed event. Now whenever I changed my text file changed event gets fired and inside this changed event I am trying to Update label.text="Something". This time it does not work. Can someone tell me what should I do to get this work. Here is the sample code DisplayLog.aspx <%@ Page Language="C#&qu...

Update panel + User Control with Update panel :|
Hi! Here's the scenario: User fills the form, and needs to select location where he lives. If location is not available, he/she can create one. So .. I have an update panel, and in this panel I insert a user control for selecting / creating location (there is an update panel in that control too), so it looks like this: <UpdatePanel>....<userControl which has an update panel in it>...</UpdatePanel> the problem is, when user presses "Create Location", it tries to validate the main update panel, and doesn't call onclick event of the control.so qu...

Maintain Scroll Position of Panel inside Ajax Update Panel.
Hi All. I have a Gridview control, inside of a Scrolling Panel, which is inside of a Update Panel, which is inside a panel, which is inside another Update Panel.  My problem is when a user scrolls down the Gridview and select a record to edit, the scroll position is lost on postback, and the user must re-scroll to find the selected record.  SmartNavigation doesn't work, I've already tried that.  I'm pretty sure JavaScript is the solution, but I haven't been able to find any solution in all my searching that will work. Here is the basic structure of my site:[U...

Having some problem wiith ajax and .net update panel
Dear All, Iam havin a strange problem in my web forms . the thing is i was not having it few days before and i have nt made any change in the code. i hav a grid in update panel which has a template field edit button. on click i call a modal popup extender which has some controls in it . the problem is when the popup appears the grid disappears... modal popup is not  in update panel.. Even more stranger behavior is that i have a button outside the update panel .onclick the modalpopup appears . and grid doesnt disappear.. If any one has any suggestions regardin this abnormal behavi...

Ajax Update Panel and Update Progress
Hello Everyone,  Its been long time since i have visited this forum, but i have a query regarding the update panel. I have a strange and weard situtaion here, which is only occuring on the web hosting server and it works absolutely fine on VSS (Local) server. The situation is i have an application where Web User Controls are placed on the web page at the design time, they are made Visible true/false at the run time. The Page where controls are placed contains the update panel and the User controls Indvidually too contains the Update Panel. These update Panel are associated with u...

custom class javascript alert in AJAX update panel
I'm using vs2005 and C#.  I have a textbox that ontextchange rasies a javascript alert.  When this textbox is inside an update panel I need to declare it as a postback trigger.  The problem is, when the textbox is inside another control, such as a Wizard, or TabContainer that is enclossed in an update panel, setting the textbox as a postback trigger does not work.  I've tried setting the Wizard to a trigger, and that results in continuous loops of postbacks.  Any help is appreciated.  See this post: http://forums.asp.net/p/1029731/1410409.aspx.&...

Event Handling in: AJAX Update Panel - or
Hello - on my form, I've got a nested datalist (inside of a nested repeater) - called "Question" [see line 49] which will create a radiobuttonlist, dropdownlist, and textbox for every row returned [lines 56-65]. The structure once compliled will look like this: Category 1 SubCategory 1 Question 1 - RadioButtonList, DropDownList, TextBox Question 2 - RadioButtonList, DropDownList, TextBox SubCategory 2 Question 3 - RadioButtonList, DropDownList, TextBox Category 2 SubCategory 3 Question 4 - RadioButtonList, DropDownList, TextBox ...

Getting JavaScipt Error Intermittently While using AJAx Update Panel, AJAX Toolkit Control
I am using UpdatePanel, ModalPopupExtender and CollapsiblePanelExtender in my ASP.NET. Locally on WinXP, everythng is working okay. But on production envirnment, I am getting JavaScript errors intermittently. I am pasting error below. When I try to debug, it shows error in "ScriptResource.xsd?d=xxxxxxx"Error: 'ig_csom' is undefined// use igcsom.getElementById wherever is possible function igtbl_getElementById(tagId) {        if(!document) return;        var obj=ig_csom.getElementById(tagId);    <=...

Update Panel in a panel
I have a search form in a panel.  I have the form in a update panel so that when certain validation error messages are displayed the whole page doesn't flash.  After the user submits the form with valid search criteria, I am hiding the panel, and showing another panel that displays search results.  Doing this without the update panel works fine, when I add the udpate panel and then try to hide the regular panel, it doesn't work.  I am hiding the panel by: adding a style display/none.  Any thoughts on this? Serena, I've had a lot of success simply setti...

Web resources about - Ajax Update panel with in user custom panel - asp.net.ajax-discussion

Saturday Night Live Weekend Update Thursday - Wikipedia, the free encyclopedia
Saturday Night Live Weekend Update Thursday is an American limited-run series broadcast on NBC . It is a political satire news show spin-off ...

Gizmodo.com Updates
Nobody should have to use a pay phone , natural disaster or no natural disaster. So if your gadgets are out of juice after Sandy, here’s a tiny ...

Lifehacker.com Updates
By Whitson Gordon Ever run into a situation where you have multiple wireless networks available, but one is clearly better than the other? WiFi ...

Facebook Messenger For Android Update Includes Conversation Shortcuts
Facebook released an update to its Android Messenger application that incorporates the group -creation and message forwarding features in last ...

Treasurer Scott Morrison to unveil $5 billion in budget cuts in mid-year economic update
Treasurer Scott Morrison will this week reveal new budget cuts worth $5 billion over four years.

Wikipedia app update adds ‘Search Wikipedia’ option when selecting text in Marshmallow
In addition to improving cut/copy/paste, the redesigned text selection pop-up in Android 6.0 Marshmallow allows developers to take advantage ...

Bloomberg Professional updates for iPad Pro with Split View, Picture-in-Picture, Apple Pencil annotation ...
Bloomberg has updated its Bloomberg Professional app for iOS with new iOS 9 optimizations including Split Screen mode and Picture-in-Picture ...

HTC One A9 update adds extra AMOLED display color profiles
... be it a Samsung Galaxy or even the new Huawei Nexus 6P. The HTC One A9 is another such device with an AMOLED display, and thanks to a new update, ...

Google updates Photos and Wallet apps for iOS with new features
In its continuing efforts to expand the capabilities of its iOS apps, Google has just updated the official iOS apps of its Photos and Wallet ...

Site News – Theme Update Is Incomplete
Folks, The theme update could have gone better, and is not done. On the “glass is half-full” side, it could have gone much worse. To avoid such ...

Resources last updated: 12/13/2015 5:58:17 PM