Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

artificially persisted web controls cause problems with the aspx handler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PJ6 - 24 Jul 2007 20:05 GMT
Taken out of context I know this may seem like a strange thing to do, but
just take this as an academic question if necessary...

Calling methods on a persisted control that has been added to a page that
has been rendered and unloaded generates these exceptions -

A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in System.dll
A first chance exception of type 'System.Threading.ThreadAbortException'
occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException'
occurred in System.Web.dll

This happens even if I take the control out of the original page, and
regardless whether I persist it as a static or a session variable.

Now I really wouldn't care about these silent errors, provided they didn't
affect anything, but this is not the case; web projects with persisted
controls tend to hang on startup - the beginning page's render method is
fired, but the browser load continues indefinitely, and pausing execution
just shows dissassembly.

Why don't I just handle .aspx myself... well I don't have access to the
methods that properly load pages. I would have to use my own control
classes, not based on any of the existing object model already provided.
Certainly doable considering I do not need view state, but this would
require additional work that I have to justify. I will be making my own
control base classes later, but the render output will not be HTML.

So... the question is, is there anyone with suffcient knowledge of the
internal workings of the .aspx handler to tell me if it is possible to
persist already rendered controls without a problem?

Paul
PJ6 - 24 Jul 2007 20:35 GMT
I changed Response.End to
HttpContext.Current.ApplicationInstance.CompleteRequest and now everything
is fixed. I had incorrectly assumed the problem was coming from the novel
direction of the web project.

Paul

> Taken out of context I know this may seem like a strange thing to do, but
> just take this as an academic question if necessary...
[quoted text clipped - 30 lines]
>
> Paul
bruce barker - 24 Jul 2007 20:44 GMT
most of the server controls use viewstate to hold all property values,
so you will need a valid viewstate. the render streams and the Page
object are also invalid.

if you want to persists controls, you should make a persisted page, then
add them to the page.

-- bruce (sqlwork.com)

> Taken out of context I know this may seem like a strange thing to do, but
> just take this as an academic question if necessary...
[quoted text clipped - 30 lines]
>
> Paul
PJ6 - 25 Jul 2007 15:49 GMT
How would you recommend creating a persisted page (differently than how the
default aspx hadler does it?) and ensuring that it is properly initialized
(OnInit/OnLoad recusrive)?

Paul

> most of the server controls use viewstate to hold all property values, so
> you will need a valid viewstate. the render streams and the Page object
[quoted text clipped - 4 lines]
>
> -- bruce (sqlwork.com)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.