|
-
May 7th, 2004, 03:33 AM
#1
Thread Starter
Frenzied Member
Server.Transfer from a user control
I need to use the Server.Transfer and my code is working fine when I use Server.Transfer from one webform to another. But if I use Server.Transer from a user control to a webform nothing happens, has anyone got an idea of whats going on?
I have remembered the EnableViewStateMac="False"
-
May 7th, 2004, 07:47 AM
#2
I wonder how many charact
You shouldn't have to server.transfer a usercontrol, because the usercontrol is a control within that page. You would simply need code like this in your Load or Prerender (depends on when u need to access or change data), where Me refers to the containing page:
VB Code:
Dim X As MyUserControl = Me.FindControl('IDofYourUserControl')
Then you could just type X.whatever to access whatever property or method you need.
-
May 7th, 2004, 08:38 AM
#3
Thread Starter
Frenzied Member
Hmm, not sure I understand. Does that mean that I can get the value of the textbox1 just by writing:
response.write(Pressure1Abs.textbox1.text)
?
My usercontrol is named Pressure1Abs, if I implement the code you wrote I get an error:
Dim X As Pressure1Abs = Me.FindControl(Pressure1Abs)
-
May 7th, 2004, 08:49 AM
#4
I wonder how many charact
what was the error exactly, a conversion error or control not found?
-
May 7th, 2004, 10:30 AM
#5
Thread Starter
Frenzied Member
Sorry, no error, but how can I get the textboxes from the user control? As I can see I can only inherit the methods and functions.
If I type X. then the textboxes are not visible and if I type
Code:
response.write(x.textbox1.text)
an error occurs.
-
May 7th, 2004, 11:30 AM
#6
I wonder how many charact
Well, you could expose its text as public property...
you could use FindControl on your usercontrol to find the textbox...
etc...etc..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|