Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Master Pages causing me grief

Reply
Thread Tools

Master Pages causing me grief

 
 
Chad
Guest
Posts: n/a
 
      06-11-2006
I want to pass a string variable from default3.aspx to default2.aspx.

I create a property in default2.aspx, called "X", and assign a value. I then call Server.Transfer("default3.aspx")

In default3.aspx I have this code:
Dim Default3 As Default3 = ctype(Context.Handler, Default3)
Dim PassedString As String = Default3.x



This will work fine as long a default 3 is not a webform that references a master page.



If it is, it tells me that "Default 3" is an undefined type. As a result, the only way that I know o get it to work is to turn of Option Strict and change it to this:

Dim Default3 As Object = Context.Handler
Dim PassedString As String = Default3.x

I really dont want to turn off Option Strict or resort to looselt typed variables.

How do I correct this?







 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      06-11-2006

"Chad" <(E-Mail Removed)> wrote in message
news:e6gaj1$fv8$(E-Mail Removed)...
>>

I want to pass a string variable from default3.aspx to default2.aspx.

I create a property in default2.aspx, called "X", and assign a value. I then
call Server.Transfer("default3.aspx")

In default3.aspx I have this code:
Dim Default3 As Default3 = ctype(Context.Handler, Default3)
Dim PassedString As String = Default3.x

This will work fine as long a default 3 is not a webform that references a
master page.

If it is, it tells me that "Default 3" is an undefined type. As a result,
the only way that I know o get it to work is to turn of Option Strict and
change it to this:
Dim Default3 As Object = Context.Handler
Dim PassedString As String = Default3.x
I really dont want to turn off Option Strict or resort to looselt typed
variables.
How do I correct this?
<<

This is group is for classic ASP for ASP.NET help try:-

microsoft.public.dotnet.framework.aspnet



 
Reply With Quote
 
 
 
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      06-12-2006

"Chad" <(E-Mail Removed)> wrote in message
news:e6gaj1$fv8$(E-Mail Removed)...
I want to pass a string variable from default3.aspx to default2.aspx.

I create a property in default2.aspx, called "X", and assign a value. I
then call Server.Transfer("default3.aspx")

In default3.aspx I have this code:
Dim Default3 As Default3 = ctype(Context.Handler, Default3)
Dim PassedString As String = Default3.x



This will work fine as long a default 3 is not a webform that references a
master page.

There is an object hierarchy, when you have a master page. So indeed,
define something as object and use this

Dim myPage as Object = Context.Handler

If (myPage is MasterPage) Then

'use subproperty to fetch the default3 page etc. I don't know yet
which one

Else

End If

If it is, it tells me that "Default 3" is an undefined type. As a result,
the only way that I know o get it to work is to turn of Option Strict and
change it to this:

Dim Default3 As Object = Context.Handler
Dim PassedString As String = Default3.x

I really dont want to turn off Option Strict or resort to looselt typed
variables.

How do I correct this?







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hidden characters in source code causing compiler grief Gary C Programming 21 04-10-2009 06:07 AM
Easy Share causing much grief Minnie Digital Photography 0 07-01-2007 05:13 PM
2 Divs side-by-side causing me grief Yobbo ASP General 3 11-12-2006 08:38 AM
Master Pages causing me grief Chad ASP .Net 0 06-13-2006 06:12 PM
Master Pages causing me grief Chad ASP .Net 3 06-12-2006 06:35 PM



Advertisments