Master Pages causing me grief

Discussion in 'ASP .Net' started by Chad, Jun 12, 2006.

  1. Chad

    Chad Guest

    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?
     
    Chad, Jun 12, 2006
    #1
    1. Advertising

  2. why don't you use PreviousPage ?



    --

    Bruno Alexandre
    (a Portuguese in Københanv, Danmark)


    "Chad" <> escreveu na mensagem
    news:e6jsp3$9p4$...
    >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?
    >
    >
    >
    >
    >
    >
    >
    >
     
    Bruno Alexandre, Jun 12, 2006
    #2
    1. Advertising

  3. Chad

    Chad Guest

    Interesting, but I still have the same issue. I want to be able to cast to
    an instage of the Default3 class (the previous page) so I can reference a
    property on that page. For some reason, I cannot CTYPE to a page that has a
    master class, which means I have to turn off Option Strict. Otherwise, it
    works. But I dont want to turn off option strict

    "Bruno Alexandre" <> wrote in message
    news:...
    > why don't you use PreviousPage ?
    >
    >
    >
    > --
    >
    > Bruno Alexandre
    > (a Portuguese in Københanv, Danmark)
    >
    >
    > "Chad" <> escreveu na mensagem
    > news:e6jsp3$9p4$...
    >>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?
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >
    >
     
    Chad, Jun 12, 2006
    #3
  4. Chad

    Chad Guest

    Re: Master Pages causing me grief-Still need an answer

    Just wanted to make it clear that my question still remains.

    "Chad" <> wrote in message
    news:e6k8kq$dhs$...
    > Interesting, but I still have the same issue. I want to be able to cast to
    > an instage of the Default3 class (the previous page) so I can reference a
    > property on that page. For some reason, I cannot CTYPE to a page that has
    > a master class, which means I have to turn off Option Strict. Otherwise,
    > it works. But I dont want to turn off option strict
    >
    > "Bruno Alexandre" <> wrote in message
    > news:...
    >> why don't you use PreviousPage ?
    >>
    >>
    >>
    >> --
    >>
    >> Bruno Alexandre
    >> (a Portuguese in Københanv, Danmark)
    >>
    >>
    >> "Chad" <> escreveu na mensagem
    >> news:e6jsp3$9p4$...
    >>>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?
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Chad, Jun 12, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    3,262
    PeterKellner
    May 16, 2006
  2. Chad

    Master Pages causing me grief

    Chad, Jun 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    359
  3. Gary
    Replies:
    21
    Views:
    8,849
    luserXtrog
    Apr 10, 2009
  4. Chad

    Master Pages causing me grief

    Chad, Jun 11, 2006, in forum: ASP General
    Replies:
    2
    Views:
    137
    Egbert Nierop \(MVP for IIS\)
    Jun 12, 2006
  5. Yobbo

    2 Divs side-by-side causing me grief

    Yobbo, Nov 11, 2006, in forum: ASP General
    Replies:
    3
    Views:
    191
    Evertjan.
    Nov 12, 2006
Loading...

Share This Page