Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 27th, 2010, 05:59 PM
Authorized User
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default System.web.httpException Error

I have created Table control dynamically added which has link button when clicked , panel control pops up.

I geeting an error:

"The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases"

-It point to the line "Form.controls.add(Panel)". Can somebody help please.

while (reader.Read())
TableRow r1 = new TableRow();
TableCell c1 = new TableCell();
TableCell c2 = new TableCell();
TableCell c3 = new TableCell();
c3.Width = Unit.Pixel(160);
LinkButton lnk = new LinkButton();
lnk.Text = "Click me to pop up";
Panel p = new Panel();
Form.Controls.Add(p); //Getting error in this line
p.Height = Unit.Pixel(80);
p.Width = Unit.Pixel(80);
p.BackColor = Color.CornflowerBlue;
AjaxControlToolkit.HoverMenuExtender h = new AjaxControlToolkit.HoverMenuExtender();
Form.Controls.Add(h);// Getting error in this line too
h.TargetControlID = lnk.UniqueID;
h.PopupControlID = p.UniqueID;
c2.Text = reader["RowId"].ToString();
c1.Text = reader["MemPrediction"].ToString();
  #2 (permalink)  
Old April 28th, 2010, 05:27 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts

It looks like the error is not grumpy with this code, but with when you're running it. Have you tried performing this at an allowed point in the page life cycle?

I like to work programatically myself, and I can confirm that it's a bit grumpy around the edges.

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Web.HttpException: Request timed out Ron Howerton General .NET 0 May 21st, 2008 08:23 AM
System.Web.HttpException: Invalid mail attachment kapi.goel C# 4 September 6th, 2007 02:48 AM
Unable to catch error HttpException (0x80004005): Shibu General .NET 6 May 22nd, 2007 04:21 AM
System.Web Error snowy0 VB.NET 2002/2003 Basics 12 October 14th, 2006 11:13 PM
error system.web....... anpham ASP.NET 1.0 and 1.1 Basics 3 July 1st, 2005 01:36 PM

All times are GMT -4. The time now is 06:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.