all groups > dotnet jscript > october 2004 >
You're in the

dotnet jscript

group:

Variables from VB.net to popup window using javascript


Variables from VB.net to popup window using javascript Cap Dor via .NET 247
10/31/2004 3:57:56 AM
dotnet jscript:
(Type your message here)
HI
I have two forms where the first form calls a popup window using javascript -- how do I pass a variable between the forms , I would like to pass the value from a text box on the first form
This is the code from the first form

Dim per as string
per = label1.text

Response.Write("<script language='javascript'> { window.open('Firms.aspx,'newin','toolbar=no, height=400, width=300 ,top=150,left = 150') }</script>")

Any help would be appriciated
Thanks
--------------------------------
From: Cap Dor

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

RE: Variables from VB.net to popup window using javascript [)an[)ea[)
11/3/2004 7:43:09 AM
You could access the value of the textbox in javascript like this:

var myTextBoxValue
myTextBoxValue = document.getElementById("textboxname").value

then pass the variable on the url like this

window.open('Firms.aspx?myPassedValue=' +
myTextBoxValue,'newin','toolbar=no, height=400, width=300 ,top=150,left =
150')

on the receiving page get the variable by using the following

myValue = request.Querystring("myPassedValue")

Hope this helps



[quoted text, click to view]
AddThis Social Bookmark Button