.NETGURU
Bad Crappy Day..
Messages   Related Types
This message was discovered on ASPFriends.com 'aspng' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

John.Horkan@ngrid.ie
Hey, I'm having one of my many (lately) bad crappy days so please help me
out here. I know this is the most basic question but on days like these...
well, you know.

Right. How do I get page level variables to hold their state through
postbacks???

eg.
<script language="VB" runat="server">
    private _intKeep as integer

    Sub Page_Load(Sender As Object, e As EventArgs)
     If Page.IsPostBack = False Then
            _intKeep = 99
        end if
    end sub
    
    sub SubmitBtn_Click(Sender As Object, e As EventArgs)
        response.write("<br>? " & _intKeep)
    end sub
</script>

*******************************************************************
This E-mail message (including any attachments) is confidential
and intended solely for the use of the individual or entity to whom
it is addressed. If you have received the message in error, please
notify Click here to reveal e-mail address.

The message has been scanned for viruses. ESB National Grid.
*******************************************************************

Reply to this message...
 
    
Paul D. Murphy (VIP)
Put it in session, application, or the statebag.

Paul

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]=20
Sent: Tuesday, May 15, 2001 10:18 AM
To: aspng
Subject: [aspng] Bad Crappy Day..
Importance: High

Hey, I'm having one of my many (lately) bad crappy days so please help
me
out here. I know this is the most basic question but on days like
these...
well, you know.

Right. How do I get page level variables to hold their state through
postbacks???

eg.
<script language=3D"VB" runat=3D"server">
    private _intKeep as integer

    Sub Page_Load(Sender As Object, e As EventArgs)
     If Page.IsPostBack =3D False Then
            _intKeep =3D 99
        end if
    end sub
=09
    sub SubmitBtn_Click(Sender As Object, e As EventArgs)
        response.write("<br>? " & _intKeep)
    end sub
</script>

*******************************************************************
This E-mail message (including any attachments) is confidential=20
and intended solely for the use of the individual or entity to whom=20
it is addressed. If you have received the message in error, please=20
notify Click here to reveal e-mail address. =20

The message has been scanned for viruses. ESB National Grid.
*******************************************************************

| [aspng] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngcurious.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
RATSEY-WOODROFFE, Jens, FM
Quick answer - you can't! You'll either need to hold it in a hidden control
on the page or store it in a state bag/session variable, etc.

J.

-----Original Message-----
From:     Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent:    Tuesday, May 15, 2001 10:18 AM
To:    aspng
Subject:    [aspng] Bad Crappy Day..
Importance:    High

Hey, I'm having one of my many (lately) bad crappy days so please help me
out here. I know this is the most basic question but on days like these...
well, you know.

Right. How do I get page level variables to hold their state through
postbacks???

eg.
<script language="VB" runat="server">
    private _intKeep as integer

    Sub Page_Load(Sender As Object, e As EventArgs)
     If Page.IsPostBack = False Then
            _intKeep = 99
        end if
    end sub
    
    sub SubmitBtn_Click(Sender As Object, e As EventArgs)
        response.write("<br>? " & _intKeep)
    end sub
</script>

*******************************************************************
This E-mail message (including any attachments) is confidential
and intended solely for the use of the individual or entity to whom
it is addressed. If you have received the message in error, please
notify Click here to reveal e-mail address.

The message has been scanned for viruses. ESB National Grid.
*******************************************************************

| [aspng] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcurious.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

********************************************************************
Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
********************************************************************

Reply to this message...
 
 
System.EventArgs
System.Web.UI.Page
System.Windows.Forms.Day




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification