Error executing child request for MyPage.aspx.

G

Guest

I am developing an ASP.NET 2.0 application using a master page. I have a
DataList control on the master page that has a datasource this is an
ArrayList of objects that have a CmdURL property. This property contains a
string that hold the name of the page to which control is redirected, e.g.
MyPage.aspx. In this scenario when the user clicks on the DataList item the
handler either executes a Server.Transfer or a Response.Redirect.

The handler is in the Master page .cs file. This scheme has worked well to
this point, but I am now getting an exception with a message, "Error
executing child request for MyPage.aspx.". What is happening? How can I fix
it?

Note: I have seen the newsgroup entry that says to use Response.Redirect,
but I get the problem with Redirect as well.

Any help is greatly appreciated.

Thanks,
Eagle
 
G

Guest

I have looked at this in greater detail in the debugger in my exception
handlers. It turns out that I have an ArrayList of objects that is being
used as a data source on a control on the MyPage.aspx. The underlying class
was not marked as serializable. After marking it the problem "went away".
The necessary information was in an inner exception and would not have been
seen in a superficial examination of the exception. Also, it took some
"chasing" through the code in exception handlers in the original page, the
master page and the target page to determine where the exception was being
thrown. It turns out the exception was thrown on the master page.

While I think I know how to avoid this problem in the future by making
classes used as data sources as serializable, I would appreciate comments on
the details of execution of Response.Redirect and Server.Transfer from within
the code-behind of master pages.

Thanks,
Eagle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top