Click here to Skip to main content
16,015,623 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: javascript doubt Pin
Bajrang Singh13-Jun-07 5:11
Bajrang Singh13-Jun-07 5:11 
QuestionHow to Scroll while drag and drop in c# Pin
Sapan Roy12-Jun-07 0:52
Sapan Roy12-Jun-07 0:52 
AnswerRe: How to Scroll while drag and drop in c# Pin
Kushi Bobby12-Jun-07 1:44
Kushi Bobby12-Jun-07 1:44 
QuestionClarification On Static Member [modified] Pin
Rahul8312-Jun-07 0:47
Rahul8312-Jun-07 0:47 
AnswerRe: Clarification On Static Member Pin
rreddy.V12-Jun-07 1:18
rreddy.V12-Jun-07 1:18 
AnswerRe: Clarification On Static Member Pin
rreddy.V12-Jun-07 1:21
rreddy.V12-Jun-07 1:21 
GeneralRe: Clarification On Static Member Pin
Arun.Immanuel12-Jun-07 2:34
Arun.Immanuel12-Jun-07 2:34 
AnswerRe: Clarification On Static Member Pin
Arun.Immanuel12-Jun-07 2:51
Arun.Immanuel12-Jun-07 2:51 
Please don't use static unless you are sure that it will not create any side effect.

Consider the following program:

<code>static int i;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void  Button1_Click(object sender, EventArgs e)
{
    i=i+1;
    TextBox1.Text=i.ToString();
}
</code>


For each Button Click event, the value of "i" is incremented and displayed in the TextBox.

I have clicked the button 5 times and the text box shows 5 in it.

At this moment,when I opened another browse , copy - paste the same url
and I tried to click the button, it shows "6" in it.


So, I think that:
For the first request, an Object of the page is created and maintained in the server.
For subsequent request separate object is created for the page and is rendered to the Client,
and the static member is shared by all objects.





Regards,
Arun Kumar.A

GeneralRe: Clarification On Static Member Pin
Rahul8312-Jun-07 4:02
Rahul8312-Jun-07 4:02 
QuestionDropdown LIst Pin
sneha0112-Jun-07 0:38
sneha0112-Jun-07 0:38 
AnswerRe: Dropdown LIst Pin
Biju Sam12-Jun-07 0:50
Biju Sam12-Jun-07 0:50 
AnswerRe: Dropdown LIst Pin
_AK_12-Jun-07 0:53
_AK_12-Jun-07 0:53 
AnswerRe: Dropdown LIst Pin
koolprasad200312-Jun-07 0:54
professionalkoolprasad200312-Jun-07 0:54 
GeneralRe: Dropdown LIst Pin
sneha0112-Jun-07 0:57
sneha0112-Jun-07 0:57 
QuestionSys.Webforms.PageRequestManagerServerErrorException Pin
yogita charhate12-Jun-07 0:07
yogita charhate12-Jun-07 0:07 
AnswerRe: Sys.Webforms.PageRequestManagerServerErrorException Pin
Venkatesh Mookkan12-Jun-07 1:41
Venkatesh Mookkan12-Jun-07 1:41 
GeneralRe: Sys.Webforms.PageRequestManagerServerErrorException Pin
yogita charhate13-Jun-07 18:35
yogita charhate13-Jun-07 18:35 
GeneralRe: Sys.Webforms.PageRequestManagerServerErrorException Pin
hrajusb29-Aug-08 8:44
hrajusb29-Aug-08 8:44 
QuestionCustom DropDown Behaviour Pin
John Gathogo11-Jun-07 23:36
John Gathogo11-Jun-07 23:36 
QuestionASP.net [modified] Pin
ling_luv11-Jun-07 23:27
ling_luv11-Jun-07 23:27 
AnswerRe: ASP.net Pin
Biju Sam12-Jun-07 0:04
Biju Sam12-Jun-07 0:04 
GeneralRe: ASP.net Pin
ling_luv12-Jun-07 15:42
ling_luv12-Jun-07 15:42 
AnswerRe: ASP.net Pin
Sylvester george12-Jun-07 1:00
Sylvester george12-Jun-07 1:00 
QuestionRun a Website/Program fast in ASP.NET Pin
.NET- India 11-Jun-07 23:23
.NET- India 11-Jun-07 23:23 
AnswerRe: Run a Website/Program fast in ASP.NET Pin
Biju Sam12-Jun-07 0:10
Biju Sam12-Jun-07 0:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.