By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
May 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I found it.
Put it out of the sub and with the key 'public'
"Chris" <cc*@sdsd.dc> wrote in message
news:Ol**************@TK2MSFTNGP05.phx.gbl...
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

May 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.