S
Servé Lau
I have been rewriting a C++ isapi into a C# asp.net application, but because
it was my first one and created within a tight schedule I have some
questions to make sure if I did it right.
1. Does asp.net create a new instance of the Page class for every request?
2.
I created a class for the settings of the application, meaning that I have
static instance holding a reference to the settings object. I'd say that
this will store one object for all users (or at least I hope so) Can I do
this or will static class members get removed when a client's session
expires?
example:
public class App : System.Web.UI.Page
{
private static SomeClass data; // do I have server side status now?
private void Page_Load(object sender, System.EventArgs e) { if (data ==
null) data = new SomeClass(); }
}
3.
the Page_Load is executed every time a request is done. What I have done is
call my main function in Page_Load, this function fills up a string member
variable. I have overridden Page.Render to write that string to the output.
Is this the correct way or is iot better to just use Page.Response.Write
like in asp?
4.
Can I change the content-type as much as I want or can I do this only once
in Render?
5.
The machine.config file holds information about worker threads and IO
threads per cpu and the request queue length.
What's the difference between a worker thread and IO thread here?
Does every thread have a request queue or is there only one?
6.
I think I know the answer to this one already but I'll ask anyway. Is
asp.net implemented that it takes threads from the global IIS thread pool or
does it implement its own pool and hands out threads from that one?
Thanks for reading if you've come this far
it was my first one and created within a tight schedule I have some
questions to make sure if I did it right.
1. Does asp.net create a new instance of the Page class for every request?
2.
I created a class for the settings of the application, meaning that I have
static instance holding a reference to the settings object. I'd say that
this will store one object for all users (or at least I hope so) Can I do
this or will static class members get removed when a client's session
expires?
example:
public class App : System.Web.UI.Page
{
private static SomeClass data; // do I have server side status now?
private void Page_Load(object sender, System.EventArgs e) { if (data ==
null) data = new SomeClass(); }
}
3.
the Page_Load is executed every time a request is done. What I have done is
call my main function in Page_Load, this function fills up a string member
variable. I have overridden Page.Render to write that string to the output.
Is this the correct way or is iot better to just use Page.Response.Write
like in asp?
4.
Can I change the content-type as much as I want or can I do this only once
in Render?
5.
The machine.config file holds information about worker threads and IO
threads per cpu and the request queue length.
What's the difference between a worker thread and IO thread here?
Does every thread have a request queue or is there only one?
6.
I think I know the answer to this one already but I'll ask anyway. Is
asp.net implemented that it takes threads from the global IIS thread pool or
does it implement its own pool and hands out threads from that one?
Thanks for reading if you've come this far