Solved

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

Posted on 2007-03-29
2
367 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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