Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing value from vb page to html page ?

Status
Not open for further replies.

stonehead

Technical User
May 2, 2007
58
US
Hi all,

This is a little complicated to explain please bear with me.
What I'm trying to do is get an interactive map base on user's choice (by either click on the image or enter the facet map #) I have 2 pages

page1: map1.aspx

Sub doSubmit(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("/IMap.aspx")
end sub

page2: Imap.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim map As String = Request.QueryString("map")
Dim facet As String = Mid(map, 1, 4)
Dim code As String = UCase(Mid(map, 5, 1))

Dim h0 As String = "0"
Dim h1 As String = "133"
Dim n_dir As String
Dim s_dir As String
(Do calculation here)

I have to do some calculations to get coord values, ect...
In the Imap.aspx page I want to have somthing like this


<a href="/IMap.asp?map=<% =nw_dir %>">NW</a> |
<a href="/IMap.asp?map=<% =n_dir %>">N</a> |
<map name="facet">
<area shape="rect" coords="<% =w0 %>,<% =h0 %>,<% =w1 %>,<% =h1 %>" alt="<% =map %>1 page" href="/iMaps/Tiles/Color/<% =map %>1.pdf">
<area shape="rect" coords="<% =w3 %>,<% =h2 %>,<% =w4 %>,<% =h3 %>" alt="<% =map %>12 page" href="/iMaps/Tiles/Color/<% =map %>12.pdf">
</map>

How do I transfer values from aspx.vb page to .aspx page ? In my old asp page, everything is in one page so I don't have problems with getting the value but now with the separated code pages, I'm so confused.
Your help is greatly appreciated
 
usually a webform consists of 3 files
Form1.aspx
Form1.aspx.cs/vb
Form1.aspx.designer.cs/vb

when you compile the web application Form1.aspx.cs and Form1.aspx.designer.cs are consolidated into the class From1 (unless your start messing with page inheritance, but that's rare, if at all.

so to expose a property to the markup create a protected or public member on the class

protected string foo {get {return "foo";}}
as an example

you can also put webcontrols in the markup and set the associated properties in the class

...onload event
mycontrol.text = "foo"; //where mycontrol is a textbox.

webforms attempts to make web design easier for desktop developers by faking state and a page lifecycle. this can make development easier for simple apps, but takes a simple concept like http/html and complicates it.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top