473,379 Members | 1,253 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,379 software developers and data experts.

Context Items on Page_Load

in

I pass a variable from one aspx page to another using Context.Item.Add

This works fine when the page first loads.

I set the value of a static global var to the value of Context.Item in
the page_load event, and use that.

However, for a button_click event, i want to use that variable, and it
seems that after a button_click is fired, all the global vars and are
set to their defaults...so I can't use that var, I have to wait until
the page_load even occurs ( which is after the button click ) !!

I converted to useing a Session var -- but, I ask: is there anyway to
accomplish my first method ?!

Nov 22 '05 #1
1 1445
Put it in Session object. That's the only rescue.
Context is limited to page and is reset everytime page it loaded.

Context = Page-Context. Everytime you load a page, you need to add it
in Context.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------------------

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: in | last post by:
I pass a variable from one aspx page to another using Context.Item.Add This works fine when the page first loads. I set the value of a static global var to the value of Context.Item in the...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
2
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
2
by: Eric | last post by:
Hi all, I have a web form that inherits from a base class. I try to access Context.Items in the base class, during the Page_Load event, and find that it is empty. When I try to access...
4
by: nicholas | last post by:
I'm using context to transfer variables from 1 page to another. But, with more than 2 pages it fails. Ex: page1.aspx: Context.Items.Add("customername", customername.text)...
5
by: | last post by:
Hoping someone can help with a simple but puzzling problem. I have some code that I want to build as a class method. The code works fine when I embed it in Page_Load. But when I try to generalize...
1
by: antonyliu2002 | last post by:
This message was originally a follow-up in a thread, but it went ignored and I do want some help so I am initiating it as a new topic. After Patrick and Karl showed me some examples, I was trying...
4
by: Hugo Flores | last post by:
Often people post questions about how did they loose their context between pages, and the more common cause is that they don't store the context on the viewstate upon postbacks. Mine is the other...
1
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.