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. Advertising

  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. 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. Tricky
    Replies:
    0
    Views:
    554
    Tricky
    Mar 19, 2009
  2. Tricky
    Replies:
    0
    Views:
    968
    Tricky
    Mar 19, 2009
  3. Reuven
    Replies:
    0
    Views:
    572
    Reuven
    Mar 19, 2009
  4. 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:
    497
  5. timr
    Replies:
    2
    Views:
    148
Loading...

Share This Page