473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to get a value of a variable from another page?

134 100+
Hello all,

I've made a variable in my masterpage but is here anyone who knows how I can get the value of it when being on a webpage?
I know the masterpage is the general page. But when loading it I am creating a new bool variable, but I want to be able to get the value of it and changing to value of it when being on for example the default page. Anyone any ideas?

Thnx in advance
Nov 13 '11 #1

✓ answered by Sl1ver

Go into Web.Config, read an article on how to add a new key to appsettings

Then all you do is bool myBool = ConfigurationManager.AppSettings["your key name"].ToString();

or else store it in a session variable, that way you will always be able to use it.

5 2091
Sl1ver
196 100+
What exactly do you want to do, do you want to be on the page, click something and go back to default with the value?
Nov 15 '11 #2
michaeldebruin
134 100+
Yeah srry my description is a little bit confusing. What I want is a variable stored somewhere and I want to be able to get the variable on every webpage. For example if I start my website as soon as the default webpage comes up. I must have created a boolean variable and when I click on a button which links me to another webpage, that webpage must be able to get the variable and it's value. The boolean variable must work just like a session when logged in.
So that means that when I log in, I must be able to change the value of the bool.
With C# I already did something like this but then I just stored the variable in a settings file, on that way it was possible to get the value of the variable anywhere I want. So if you have any ideas how to do this with a ASPX website I would like to hear that.

I know there are better ways to do something like this and also safer ways but the website is not going online anyway, it is just for a school project.
Nov 15 '11 #3
Sl1ver
196 100+
Go into Web.Config, read an article on how to add a new key to appsettings

Then all you do is bool myBool = ConfigurationManager.AppSettings["your key name"].ToString();

or else store it in a session variable, that way you will always be able to use it.
Nov 15 '11 #4
michaeldebruin
134 100+
oke thanks a lot Sl1ver
Nov 15 '11 #5
PRR
750 Expert 512MB
Hi Michaeldebruin,
I would suggest ASP.NET State management Overview

Join Bytes
Nov 22 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tim | last post by:
In my case, I type <a href = 'decode.php?song=$choice'>Decode</a> in one of the php file. But after I click the link, the decode.php page can't get the value $choice, I would like to know the...
2
by: Mike P | last post by:
When you are passing a value to another page, and will need access to it throughout the page and on any postbacks, what is the best way to store it? By making it a variable accessible to the whole...
3
abdoelmasry
by: abdoelmasry | last post by:
Hi Friends i need help in sessions im passing variables between pages using sessions this is the main page thats mean the home page the main page have table to show messages for users , it have...
11
by: dkate777 | last post by:
Hi, Is anybody know how to pass textbox input value to another page. I am using document.secondform.fieldname.value=document.firstformname.fieldname.value but it's not working Thanks
2
by: stephen | last post by:
Hi, I have a button on a webpage. Clicked event of this button opens another page for search and populates a datagrid or whatever and then I want to return value from this second page on to the...
3
by: jmash | last post by:
Hello, The requirement is to display rows of data on a classic ASP page for rows in a recordset. On each row we have a link at the end to show detailed information about the selected row. A...
1
by: mentor | last post by:
in first page, <form id="form1" runat="server" action="page2.aspx"> <TEXTAREA id="txt1" runat=server></TEXTAREA> <INPUT type=submit value=submit name=rev_submit> in second page(c#) string...
2
by: digituf | last post by:
i have 2 forms here. 1) DisplayDetails.php 2) RegistrationForm.php when user click to the link 'Next' at the DisplayDetails.php page it will bring all the session value to the...
1
by: sandhya karki | last post by:
I have three combobox for menu ,submenu and subsubmenu. When I click the first combox ,second combobox should be appeared displaying the value related to the first combox box and when i click the...
2
by: dougancil | last post by:
I have a page with a gridview and I want to pass the value when a user clicks on a hyperlinked field in the grid to another page. Here is the code for the gridview: <asp:GridView ID="GridView1"...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.