Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
imap mails 1 25
jquery datatables, asp.net MVC 9 51
List<PaisEntity> - show some 1 28
Where is this file? 3 25
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…

856 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