Solved

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

Posted on 2007-03-29
2
347 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

19 Experts available now in Live!

Get 1:1 Help Now