Passing a variable to another page in a session variable

I want to pass a string to another page I'm opening with JavaScript using a session variable.  The problem is, I might be opening 3 or 4 instances of this new window at the same time and I will need to pass a different value to each instance.

Is there a good way to do this?
0
kenp2600
10/5/2004 7:51:00 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
957 Views

Similar Articles

[PageSpeed] 8

well, the process you describe is off. there is no "passing", really, when using session state. once it's in there, it's in there across ALL page requests (even if that page request is opened through a javascript window.open() method). So it won't matter how many pages you access, or how many times, once it's in session, it's always available to asp.net (so long as it's in the same domain, and a .net page (.aspx)). but because, as you said, you're changing this value every time you access the page, then it would make more sense to actually "pass" a value by using a query string because, unless you reset the value in the new page (i don't exactly know WHY you're doing this so it's hard to say) that value could potentially be lost. so it would be better to maybe do something like this: e.g.

(javascript)

window.open("http://www.mysite.com/mypage.aspx?name=george", "");

Where "name" is the name of the item passed, and "george" is the value of the item "name".
You can even get the value of "name" using javascript OR asp.net. And if the name and value had to be dynamic, you could just add the javascript on the server.
MCSD / MCAD / MCP
0
chapel21
10/5/2004 8:50:39 PM
Reply:

Similar Artilces:

Passing A Session Variable Form Page to Page ~ No Working
Hi All, I am trying to passing a session variable from Page to Page but its not working! the user basicaly logins in on the login.aspx and when their credentials are verifed by the MSSAccess database they are tehn redirected to the next page...heres a snip of code ~~~~~~~~~~~~~~ session("ID") = dslogin.tables("UserInfo").rows(0).item("ID") response.redirect("./success.aspx") ~~~~~~~~~~~~~~~~~~ Heres the code for the page I am trying to access after beigng verifed ~~~~~~~~~~ sub page_load(byval sender as object, b...

passing a variable form one page to a sql query in another page
hi, i have a categories page and when the user clicks on a category it is to go to a products page which list all the products in that category. i cant believe it can be that difficult. ive been all round the block on this and have posted a number of messages on another forum but the trail went cold. the story so far... http://www.sitepoint.com/forums/showthread.php?t=396963 any help would be muchly much appreciated! You have several options:  QueryString: You can use querystrings to pass variables from one page to another.  If you are using ASP.NET 2.0, you can use Cross ...

Passing variable from function to session to another page
Hi guys, Im having some trouble with passing a randomly generated password from the function to the session variable. the following is the code, <script runat="server"> Sub Submit_OnClick(sender as Object, e as EventArgs) If Login (txtUserID.Text) Then Dim password As String Session( "txtUserID" ) = txtUserID.Text Session( "UserPword") = password Server.Transfer("./emailpass[1].aspx") Else ' Invalid credentials supplied, display message lblMessage.Text = "Invalid log...

Passing Session Variables from one page to another
On the first page, I have a search form.  I am trying to save all of the user's search parameters to the session, and I am displaying the user's search results on the second page using a control that pulls the values from the session.  (I wanted the form and the results to be on two different pages for "look and feel" purposes associated with my website)   The problem that I am having is that the first page isn't actually saving the values to the session.  I have enabled sessions in my web config file, and I actually have this working fine on ...

Passing form variable from page to page
I have application which requires to pass form variables from page to page.   Basically, it's registraion web site. I have 4 diffferent page which collect information from end user. For example: Page 1: default.aspx Page 2: Survey.aspx Page 3: Profile.aspxPage 4: Classes.aspxPage 5: payment.aspxPage 6: Finished.aspx So, at the end of page 6, i would like collect all the form variables and then insert into database. thanksaj This may not be the answer for which you're looking, but this might be wll suited to using a wizard all on one page.....just...

How to pass variables within pages without showing it in URL and not using session variables
My aspx page need to be called from within another page. My page must receive 2 values (variables) form the page that will request may page, and  must hide these values (it can not appear in the URL). It seems that I must use  the get/post method, but Idont know how. Can someone show me a example with 2 small pages showing how one page can request another passing values (not showed in the URL)     tanks in advance   Take a look at this... http://www.codeproject.com/aspnet/DataPassingBtPages.asp?df=100&forumid=109242&exp=0&select=9...

How to pass variable from a page to another page?
Hi,I have a default.aspx page with default.aspx.cs. Under default.aspx.cs, I have String firstName = datakey.Substring(firstName, 3); and I want to pass firstName into another page's textbox with id firstnameTxtbox under menu.aspx. Can anyone pls show me any ways to do it?Thanks  Check below link http://www.dotnetbips.com/articles/displayarticledetails.aspx?articleid=79 HCHaissam Abdul MalakMCAD.NET| Blog |...

How do I pass a session variable from one web application to another?
Hi.  I need help passing an OrganizationID from one web application, to another.  The two web applications are on the same server.  I have tried creating a session variable, but it must go out of scope, when the user navigates from the first web application to the next.  Is there a way to pass a variable from one web application to another in a secure way?  I can't use a standard querystring, as it would compromise security.  I'd rather use a session variable, (or something like it.)  Any help would be greatly appreciated.  Peter Would ...

Who to passing a Variable One web page to other page ??
Who to passing a Variable One web page to other page ?? pl. also differant way of passing variable one page to other page If you find it absolutely necessary to pass values between pages (which is the Classic ASP way of dealing with things) you could read this: Passing Server Control Values Between PagesRegardsAndre Colbiornsen ---------------------------------Seventh DayRåbygatan 1A,SE-223 61 LundSwedenMob.: +46-(0)708-97 78 79Mail: info@seventhday.se--------------------------------...

Passing variables vs session variable
what is the advantage of passing the variable in the url vs storing the variable in a session variable and retrieving it in the second webpage you are accessing?  The variable that you will pass using the QueryString will be visible to the user hence not secured. The value that you put in the Session is not available to the user as it is on the server side and hence more secured. HighOnCodingWanna get high! performance wise does it matter? Just my 2 cents... I remember in college the professors would always harp upon using the Session responsibly. Most of the professors were old...

how to call a session variable from the default page to another page
Actually, i hav a dropdown  list of all states of india on  my default page.so,when a user l login along witha particular state,he can see the details of tht particular state in every pages.By default,all details should be of india.For that, i hav declared session variable on default page,tried to call tht session variable in each page.But,it failed to display the textfiles of a chosen state.i have created one common folder named as StateFiles for all state folders,in each statefolders,there r textfiles for each page.here,i m sending my code of default page & one other page.Ple...

How tocall session variable from default page to another page
Actually, i hav a dropdown  list of all states of india on  my default page.so,when a user l login along witha particular state,he can see the details of tht particular state in every pages.By default,all details should be of india.For that, i hav declared session variable on default page,tried to call tht session variable in each page.But,it failed to display the textfiles of a chosen state.i have created one common folder named as StateFiles for all state folders,in each statefolders,there r textfiles for each page.here,i m sending my code of default page & one other page.Ple...

How to Access/Pass Server Side Array Variable at Another Web Form's Client Side
Hi All,I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets....Thanks in advance.Senario is like this.....in A.aspx (using C# .net 2.0 as code behind) I am going to have a array variable basically it is an TWO Dimensional array after populating the values in array I need to redirect/ reload another web form B.aspx, here i need to access the array in B.aspx client side JavaScript.How can I do this...Thanks AgainRaju Dont do a redirect but use server.transfer. That way the previous page will still hold its value, ...

I am attempting to post to another page and pass a form text box to a sql data source as a query variable.
Hello. I used to use dreamweaver and vbscript to post a form to another page and then use Request.Form to get the variable from the form and put it in a query. I have been trying to do the same in ASP.net. I have managed to get it to work with postback. However when I change the property of the submit button to post the page to another page and specify on the target page a form variable in a data source it does not work. It just reverts to the default. Is there something else I need to set up for it to pick up the form variable from the source page? All help would be gratefully appreciated....

Web resources about - Passing a variable to another page in a session variable - asp.net.web-forms

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Cisco Debuts Open Pay Variable Pricing, Updates CCRE
Cisco Debuts Open Pay Variable Pricing, Updates CCRE Channel Partners Kris Snow, president of Cisco Capital, says the company's new Open Pay ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

Resources last updated: 12/11/2015 9:24:49 AM