Changing Label property

V

Viktor Popov

Hi,
I'm working on a project that I develop with ASP.NET/MS SQL/C#. When I check
username and password in WebForm1 and they are wrong, I forward the users to
another WebForm2 which have a Label. I'd like to change the Text property
of this Label not in OnPageLoad function of the WebForm2. I'd like to do
that in WebForm1. How could be accoplish that?

Thank you in advance!

Viktor
 
I

Ignacio Machin \( .NET/ C# MVP \)

You cant,

When you are executing page1 a page2 instance does not exist yet.
You can pass the value as a parameter though. or in a session variable.

Cheers,
 
E

Eliyahu Goldin

Web server processes one page at the time. When you navigate to WebForm2,
WebForm1's gone. The only thing it can do is to pass new text via one of the
standard ways of passing parameters between pages.

Eliyahu
 
C

clintonG

Meaning -- use WebForm1 to populate a Session variable with the
value of the label's text. When WebForm2 is loaded read the
Session variable and assign the value to the label on WebForm2.


--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top