Solved

Variable from Code Behind, being used on Web Form Page (VB ASP.NET)

Posted on 2007-03-29
2
359 Views
Last Modified: 2008-02-07
I have a variable that in the Page_Load event of my code behind page is being used.  When the Page_Load event is over and the page loads, I need that variable to be in a link that is currently setup.  It is not a button or asp hyperlink of any sort.  The link is acutally in a part of an area map.  I just need to be able to send through the one variable when the user clicks on that image (part of the map).  Regular ASP tags are not working and I think my syntax is wrong.

"Register.aspx?Id=<%=Id%>"

How do I get my Form page to recongize that variable from my code behind?

Thanks in advance,
Eric
0
Comment
Question by:tgidirect
2 Comments
 
LVL 37

Accepted Solution

by:
samtran0331 earned 250 total points
ID: 18821292
in the codebehind, declare your variable outside o f any sub/function and make sure it isa public var...

like:
partial class webform1
inherits system.web.ui.page
public ID as integer
sub page_load...
ID =3
end sub
....
0
 

Author Comment

by:tgidirect
ID: 18822676
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Editing XSL files, 2 41
Asp.net mvc entity issue 6 31
How to access a DataBinder.Eval variable using C# ? 4 27
Vb.net dynamic formulas in runtime 11 61
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now