global variable/object without session or application variable

Hi All,

I have 1 or more dynamically assigned user controls. Now i need to pass a user control's value to another user controls during page load. We can do using session variable, but the problem over here is it would slow down my application. So i would like to attain this without using the session or application variable.
Please let me know if you have any questions.
Thanks,
thiya
Thank you in advance. I am pleased to return the favor.
0
thiya
1/10/2005 5:47:30 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies
849 Views

Similar Articles

[PageSpeed] 49

Read this post.
Jared Livingston
MrLivingston.com - Livingston Family Website

Test/Demo site - moonmark.com
0
wunderkinder
1/10/2005 7:12:17 PM
Reviewed the posted reply. That one was not answering the questions above. The real issue is on sharing the values between 2 user controls. Is there any other solution for this thread?


sjn
0
Johnson
1/10/2005 8:52:21 PM
Does the word "extrapolate" mean anything to you?  Sheesh.  Let me spell it out for you.

If you want to access the properties of an instance of a control from anywhere else in your code, you need to build a reference to the control. Not just a reference to any instance of the control, but to a particular instance. The following method will allow you to do this.
Create a Globals class. In the Globals class, declare objects which you want to store globally. If you want access to a string, declare a string variable. If you want to access the properties of a control, declare an instance of the control in the Globals class. When you actually load the control in a page, set the instance of the control in the Globals class to the instance of the control in your page (Globals.mControl = Page.mControl). You will now be able to access properties of the control that has been loaded in the page.
I have uses this method multiple times, so I know it works.


Jared Livingston
MrLivingston.com - Livingston Family Website

Test/Demo site - moonmark.com
0
wunderkinder
1/10/2005 10:12:50 PM
Thanks for your reply.

I have explained more about this probelm in the following URL.Kindly take a look and help me out
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=794884
Thanks in advance.
Thiya

Thank you in advance. I am pleased to return the favor.
0
thiya
1/11/2005 3:14:54 PM
Reply:

Similar Artilces:

Complex Objects Stored in the Cache, as Application Variables, and as Session variables
I don't know why, but I had always thought that if I was dealing with a DataTable stored as a Session variable, that if retrieved it from the Session pool and made changes to it that I had to explicitly stored it back in the Session pool in order for those changes to be "permanent".  I just discovered that this is not true.  And it actually makes sense why I don't.But I'm curious, if instead I was using the Application variable pool or the cache, would it work the same way or would I, in fact, have to explicitly store the altered object back?Robert Robert...

acessing variables across web forms( a la Global variable)
Hi, I have multiple web forms in my application i want to access some data( from sql database) which is common to all the forms. i want to retrieve the data only once & use it for all the forms. as ther are are no global variables in .net can anyone suggest how i can implement this ? lonewolf If the data is small enough, use the Session. It is like viewstate, but held on the server. To access it, do the following in the code behind: E.g Let's say you want to store login information, i.e. userid. Then... To set the variable (typically done on your login page): Dim useri...

Global Variables vs. instance variables declared at application object level
There is only one application object instance during the application runtime that is instantiated at the start along with the global variables, so I am looking for what are the major differences, advantages , and disadvantages between Global Variables and instance variables declared for the application object. Thanks I've wondered also about the application instance variables. I think the difference with global vars is very subtle. Maybe too subtle to be of any use. Anyway, you shouldn't be using either one of them :-) Geert 'Darling' Van Damme Moh...

How can I use a variable on my entire application without using Global Variable?
Hi. At the sign on screen of my application, I get from the employee table ten field of data. This fields indicated the privileges of what the user has authority to work on. The question is, how can I use this ten field all over my application without using Global Variable? Structure, I think will not work because it get destroyed unless there is a Global Structure. If somebody knows please let me know. Will still look on the help of PB. Thanks Edgar The PFC handles this by the use of a single global variable - an NVO. The alternative is to have this in an NVO that ...

Acessing variables, objects and functions from javascript to VB .NET Web Forms
I have included some javascript files in my vb.net application. I want to access the variables, objects and functions of Javascript to the VB.NET Web Forms, which means that I want to transfer the methods from Javascript to the code-behind in a web form. How do I do this? Can anybody help me with some sample codes...thanks in advance . you can't pass javascript variables (client side) to code-behind (server side). you can however put your variables into hidden input fields then access those input fields from code-behind. or use ajax I think the only way to do this is...

Use of Application Variable and Session Variable
Hi all, please someone tell me when should a Application variable be used and in what conditions a session variable should be used? regards Subhajit As the name of the variables suggest, an Application variable is suitable when the value of this variable should be available to all users of your application from the point the Application is started for the first time. A Session variable, on the other hand, may be different for different users and only exists for the duration of a users visit to your application or until it times out. Hth.RegardsAndre Colbiornsen ----------------...

Acessing variables,arrays, objects and functions from javascript to VB .NET Web Forms
I have a textbox where user can put data.I store data into an array .I did this with java script.now i want to acess the array from the Codebehind  in vb.net web pages.here is the codefunction MakeArray( n ) { if( n <= 0 ) { this.length = 0; return this; } this.length = n; for( var i = 1; i <= n; i++ ) { this[ i ] = 0; } return this; } var Form1 = new MakeArray( 25 ); var index = 0; var cmmnd = 1; function f_store( sTR ) { var i; if( index >= Form1.length ) { for( i = 1; i < Form1.length; i++ ) Form1[i-1] = Form1; index = Form1.length - 1; } Form1[ index ] = cmmnd + ":" + sT...

Needed Experts Only Reply: Unable to access dynamic user controls data using global variable (except session/application variable)
Hi All, I have 1 or more dynamically assigned user controls. Now I need to pass a user control's value to another user controls during page load. We can do using session variable, but the problem over here is it would slow down my application. So I would like to attain this without using the session or application variable. Please go through my sample codes below; User Control 1: ------------------ Public Class UserControl1 Protected WithEvents txtFirstName As System.Web.UI.WebControls.TextBox Protected WithEvents txtLastName As System.Web.UI.WebControls.Text...

Request to Core Team Members : Unable to access dynamic user controls data using global variable (except session/application variable)
Hi All, I have one or more dynamically assigned user controls. Now I need to pass a user control's value to another user controls during page load. We can do using session variable, but the problem over here is it would slow down my application. So I would like to attain this without using the session or application variable. Please go through my sample codes below; User Control 1: ------------------ Public Class UserControl1 Protected WithEvents txtFirstName As System.Web.UI.WebControls.TextBox Protected WithEvents txtLastName As System.Web.UI.WebCont...

Defining autoinstantiate variables as global application variables
Hi, I�ve defined several global application variables that were autoinstantiate Non visual classes. After doing that strange problems happened: When saving window objects PB always crashed. No errors when rebuilding PBL�s or regenerate. After moving these global variables to application manager NVUO (defined as global but not autoinstantiate ) all problems disappeared. I�m well aware about the problem defining global autoinstantiate variables at PB 6. Why this problem did not fixed in the last PB 7 build? General info: PB 7 build 7024 , NT 4 SP 5 Shay Shay, ...

variable of variables
Say I have 2 scenarios and I want to use a different variable depending on which scenario applies without coding this logic. So I could have a database table t_variables which has: Scenario: Variable: --------- -------- 1 v_name 2 v_company In my Powerbuilder code I'd have values in v_name & v_company. What I'd like to be able to do is to select which variable to use from the table and assign that to something, e.g. select variable into v_variable from t_variables where scenario = 1 so at this point v_variable would be 'v_name'...

Global Variables for Each Instance of a Web Application
I am developing some modules for DNN 1.10 and I have a question regarding scope. The module I am writing is part of a set of modules that essentially allow my company to interface our ecommerce software with the awesome base of DNN. These modules must retain a userid that all modules use to tie everything together as far as a customer session goes. I wanted the use of the userid to be transparent to me as I developed so I made a public shared property called uid that would get a new uid once and then not until the end of that application's instance - or so I thought. For each codeb...

Storing variables without the session object
I have a server control that within itself has a variable called "sQuery".  I would like to store that variable in a session (Session["sesion1"] = sQuery;), but I cannot because the class is derived from a base class and not from "System.Web.UI.Page" therefore I can't use the Session object. Is there another way to do that?  Eventually I would like to be able to pass that variable into the code behind, I know how to do that, but before passing I have to be able to store the variable somehow.    Thanks in advance Hi, you sho...

Variable Variables
Hi, Maybe the solution is very simple, but how do I create variable variables in vb.net? I want to use the value of a variable as a part of the name of another variable. A very simple example below: code: Dim a As String a = "1" Label a.Text = "hi" page: <asp:Label id="Label1" runat="server">Label</asp:Label> In need this to change a range of values by using just one loop. I can´t do that without creating a variable variable name. Hi, check out this little demo application I created for you: ...

Web resources about - global variable/object without session or application variable - asp.net.web-forms

Application - 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 ...

Welfare experiment may have applications in Australia
A trial in Finland providing an obligation-free basic income could change how we think about welfare.

Apple patent application reveals exciting possibilities for twin-camera system rumored for iPhone 7
We heard a report in November that Apple was testing an iPhone 7 model with dual rear cameras , and a patent application published today not ...

Seagate Introduces First 8 TB Hard Disk Drive for Consumer NAS Applications
Seagate Technology on Tuesday introduced its new breed of hard disk drives (HDDs) for network area storage (NAS) and RAID applications. The new ...

Panasonic Develops a Stretchable Resin Film and Its Application Materials for Stretchable Electronics ...
A stretchable film is developed. This film stretches to 2.5 times the original length and then returns to the original form. A conductive paste ...

MBA: Mortgage Applications Decreased Over Two Week Period in Latest MBA Weekly Survey, Purchase Applications ...
From the MBA: Mortgage Applications Decreased Over Two Week Period in Latest MBA Weekly Survey Mortgage applications decreased 27 percent from ...

Mortgage applications sink after rush
A Fed rate hike pulled mortgage demand forward, and made for a steep drop-off in the past two weeks.

SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika
SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika

In Application To Move To Los Angeles, Rams Shit All Over City Of St. Louis
... to relocate to the greater Los Angeles metropolitan area. The relocation would be effective for the 2016 NFL League Year.” The Rams’ full application ...

Seagate pushing non-PC storage for 2016 with focus on surveillance applications
... products for cloud computing, consumer electronics, surveillance and enterprise storage for 2016. Seagate expects surveillance-related applications ...

Resources last updated: 1/13/2016 6:30:18 PM