Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine calling form?
Message
From
17/12/2002 13:12:13
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00733615
Message ID:
00733767
Views:
102
Cathi,

Would assigning the ViewState using a constructor (set) for the textbox be one way of doing it? If so, could you show me an example? I tried, but I am not being very successfull.

Thanks!

>Hi Larry,
>
>You would need to save the information for the label in session state. When you move to another page, the view state for the page is lost and you don't have reference to Form1.
>
>>>>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