passing text from one frame/page to another

Discussion in 'ASP General' started by Timmins, Jun 12, 2004.

  1. Timmins

    Timmins Guest

    I have a date in a frame/page that i want to pass to another page. I can succefully pass a static value, i just can't pass a value from a text box.

    I tried to make everything public. I believe that Me. may only refer to the page that is orginating the action. But how do I pass the text box. Can we assume since I can pass the static value, that the issue is how I grab the textbox value

    the Error i get is
    Object reference not set to an instance of an object

    Here's the Property that is giving me trouble:

    Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
    Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
    Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
    Public DatePublicVar As String

    Public ReadOnly Property FromDateTxt() As String
    Get
    'DatePublicVar = "12/12/2004" ' This Works
    DatePublicVar = Me.FromDate.Text 'this doesn't
    Return DatePublicVar
    End Get

    End Property

    Thanks, I'm an old vb guy who still hasn't found out how to do some obvious tasks
     
    Timmins, Jun 12, 2004
    #1
    1. Advertising

  2. Timmins

    Slim Guest

    "Timmins" <> wrote in message
    news:...
    > I have a date in a frame/page that i want to pass to another page. I can

    succefully pass a static value, i just can't pass a value from a text box.
    >
    > I tried to make everything public. I believe that Me. may only refer to

    the page that is orginating the action. But how do I pass the text box. Can
    we assume since I can pass the static value, that the issue is how I grab
    the textbox value
    >
    > the Error i get is
    > Object reference not set to an instance of an object
    >
    > Here's the Property that is giving me trouble:
    >
    > Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
    > Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
    > Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
    > Public DatePublicVar As String
    >
    > Public ReadOnly Property FromDateTxt() As String
    > Get
    > 'DatePublicVar = "12/12/2004" ' This Works
    > DatePublicVar = Me.FromDate.Text 'this doesn't
    > Return DatePublicVar
    > End Get
    >
    > End Property
    >



    unless your form is called "me" no this wont work

    if your text box in in a form
    form1.texbox1.value

    if not its
    texbox1.value





    > Thanks, I'm an old vb guy who still hasn't found out how to do some

    obvious tasks
     
    Slim, Jun 13, 2004
    #2
    1. Advertising

  3. Timmins

    Bob Lehmann Guest

    Your control, FromDate, is probably out of scope.

    You should ask this question a DotNet group.

    Bob Lehmann

    "Timmins" <> wrote in message
    news:...
    > I have a date in a frame/page that i want to pass to another page. I can

    succefully pass a static value, i just can't pass a value from a text box.
    >
    > I tried to make everything public. I believe that Me. may only refer to

    the page that is orginating the action. But how do I pass the text box. Can
    we assume since I can pass the static value, that the issue is how I grab
    the textbox value
    >
    > the Error i get is
    > Object reference not set to an instance of an object
    >
    > Here's the Property that is giving me trouble:
    >
    > Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
    > Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
    > Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
    > Public DatePublicVar As String
    >
    > Public ReadOnly Property FromDateTxt() As String
    > Get
    > 'DatePublicVar = "12/12/2004" ' This Works
    > DatePublicVar = Me.FromDate.Text 'this doesn't
    > Return DatePublicVar
    > End Get
    >
    > End Property
    >
    > Thanks, I'm an old vb guy who still hasn't found out how to do some

    obvious tasks
     
    Bob Lehmann, Jun 13, 2004
    #3
    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. Søren M. Olesen
    Replies:
    0
    Views:
    601
    Søren M. Olesen
    Nov 13, 2003
  2. Noozer
    Replies:
    0
    Views:
    3,018
    Noozer
    Oct 22, 2005
  3. Fokke Nauta
    Replies:
    3
    Views:
    972
    Fokke Nauta
    Apr 29, 2009
  4. Robert Cohen
    Replies:
    3
    Views:
    295
    Andrew Durstewitz
    Jul 15, 2003
  5. Kathryn
    Replies:
    4
    Views:
    373
Loading...

Share This Page