Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine calling form?
Message
From
17/12/2002 11:06:52
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00733615
Message ID:
00733700
Views:
22
>>C# Newbie Question...
>>
>>I have a simple web form that gets called from a couple of other form using the System.Web.Transfer("WebFormName.aspx") command. (i.e. Form1 and Form2 both can call Form3.
>>
>>How do I determine whether Form1 or Form2 was the calling form?
>>
>>I know I could use a system variable and store the form's name in it and test against that, but I was wondering if there is a system function equivalent to System.Web.TransferedFrom()?
>>
>>TIA,
>>Larry Long
>>
>>p.s. I just came back from Kevin McNeish's 5 day ASP.NET, C# for VFP Developers training and it is WELL worth it!! We had a great time, learned a lot...my brain still hurts...and Kevin treated us all very well!
>
>Would: Request.UrlReferrer give you what you want? It will return the URL of the previous page (ie. the referring page).

Form1 - User enters name in a textbox and the OnChange method issues Server.Transfer('Form2.aspx')

Form2 - Shows a label with "Hello "+username and two buttons, one to go back to Form1 and another to go to Form3

The Form2.Page_Load method is

if (!IsPostBack && Request.UrlReferrer.AbsolutePath == "/Hello/Form1.aspx")
{
Form1 sourcepage = (Form1) Context.Handler;
Label1.Text = "Hello "+ sourcepage.TextBox1.Text;
}

Form3 - Shows other info

When I return from Form3, Label1 is empty.
How can I keep the current value in Form2.Label1?

Thanks,
Larry
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform