how to pass a variable from test.aspx.vb to test.aspx?

Discussion in 'ASP .Net' started by Chris, May 11, 2006.

  1. Chris

    Chris Guest

    Hi,

    I use code-behind, but how can i pass a variable from test.aspx.vb to
    test.aspx?

    Test.aspx.vb contains this:
    Partial Class test
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load

    dim lol as string
    lol="Carl"
    .....


    In test.aspx, i want to have: hello Carl
    So i did:
    <form id="form1" runat="server">
    <asp:Label Runat="server">Hello <%=lol%></asp:Label>


    But i get the error: "Name 'lol' is not declared"

    Thanks
    Chris
     
    Chris, May 11, 2006
    #1
    1. Advertisements

  2. Chris

    Chris Guest

    I found it.
    Put it out of the sub and with the key 'public'


    "Chris" <> wrote in message
    news:...
    > Hi,
    >
    > I use code-behind, but how can i pass a variable from test.aspx.vb to
    > test.aspx?
    >
    > Test.aspx.vb contains this:
    > Partial Class test
    > Inherits System.Web.UI.Page
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    >
    > dim lol as string
    > lol="Carl"
    > ....
    >
    >
    > In test.aspx, i want to have: hello Carl
    > So i did:
    > <form id="form1" runat="server">
    > <asp:Label Runat="server">Hello <%=lol%></asp:Label>
    >
    >
    > But i get the error: "Name 'lol' is not declared"
    >
    > Thanks
    > Chris
    >
    >
     
    Chris, May 11, 2006
    #2
    1. Advertisements

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. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,596
    Matt Morris
    Jan 23, 2004
  2. Podi
    Replies:
    2
    Views:
    433
  3. Ben Kial
    Replies:
    1
    Views:
    947
    Eric Enright
    Nov 15, 2004
  4. mfglinux
    Replies:
    11
    Views:
    981
    Roberto Bonvallet
    Sep 12, 2007
  5. Tricky
    Replies:
    0
    Views:
    799
    Tricky
    Mar 19, 2009
  6. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    1,040
    Skybuck Flying
    Oct 4, 2009
  7. Chris

    how to pass a variable from test.aspx.vb to test.aspx

    Chris, May 11, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    853
  8. timr
    Replies:
    2
    Views:
    335
Loading...