Cache Variable vs. Session Variable
I'm anxious to get some feedback with regard to using a cache variable in lieu of a session variable.
My research tells me that caching is the way to go for maintaining state on datasets. However, I've only seen the cache variable discussed as an alternative to an application variable (as opposed to the session variable). I'm actually exploring the idea using of using a cache variable as an alternative to a session variable for maintaining state on a dataset specific to each user (Each user is able to select the fields they wish to view; the user will then be able to page and sort on th...Passing a variable to another page in a session variable
Is there a good way to do this?
On page preinit i am adding few session variables.
Now i want to retrive these session variable values into my static variables.
protected void Page_PreInit(object sender, EventArgs e)
i have few static variables which shud contain these vaules.
public string TT;
public string TT1;
public string TextForeColor =sess = "#FFFFFF";
i want to get T value into TT ... T1 into TT1..and so on
&n...Can't get a new Session Variable to pass into a method (used Session, TextField and QueryString)
I have been battling with this for about 18 hours now and coudl use some help...
I have a form that inserts into a DB table and then calls a method that makes a query to another table to create a Dataset for insert into a third table. ( I haven't done the third table insert yet but first things first.) Step 1 works fine. Step two is the problem. When I call the method I pass in two variables to get return it will only work if I call an OLD Session variable. The session vaiable i set in the onSelectedChange event won't pass into the parameters... I als...variable not a variable
Error:Must declare the variable '@cartDateTime'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Must declare the variable '@cartDateTime'.
Dim connStr As SqlConnection Dim cmdInsert As SqlCommand Dim strInsert As String &n...variable of variables
Say I have 2 scenarios and I want to use a different
variable depending on which scenario applies without coding
So I could have a database table t_variables which has:
In my Powerbuilder code I'd have values in v_name &
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.
where scenario = 1
so at this point v_variable would be 'v_name'...variable variables?
How to make a variable receive an increment in the name?
I want to do it for example:
Label1->Caption = "1";
Label2->Caption = "2";
Label3->Caption = "3";
Label4->Caption = "4";
And I want to do something like that:
for (i=1; i<5; i++)
Label+i->Caption = i;
Any idea? Can I do something like that?
Thanks and regards
Create a vector of pointers to the various objects.
In your case below, construct a vector (called Labels) of pointers to TLable
long enough to hold pointers to...Variable Variables
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:
Dim a As String
a = "1"
Label a.Text = "hi"
<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.
check out this little demo application I created for you:
...Passing a variable to a sub (WAS: passing a variable to a module)
This is really more of a question of how to pass a variable to a sub. First
off, check out perldoc perlsub. To avoid problems like this, 'use strict'
whenever possible at the top of your scripts.
Anyway, here's how to fix this:
Passing a variable to a sub: All variables passed to subs are put into the
@_ array and then passed. Thus, when you do a printStatement($var), the
contents of $var are passed to the first element of the @_ array. In the
sub in your module, there is no such thing as the variable $var. If you had
used 'use strict', you would have ge...Response.Redirect with Session Variable vs. Global Variable -- Best Practices?
Hi,I have a simple contact form and when the user presses the submit button an email is sent and I have a response.redirect to "emailSent.aspx" where it says "Your request has been received....etc.". I have the submit button in a try/catch block. What I want to do is a "emailFailed.aspx" where it says "Email problem, etc." but I also want to carry over the ex.message text. I want to pass the ex.error text to the "emailFailed.aspx" page so on pageLoad I can have a label with something like:labelMessage.Text = "There was a problem with your email. The error is " +...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...shared variable or session variable???
I've asked this question on a couple of different forums and usenet and noone has offered a reply, so I thought I'd try it here...
I have 2 different web apps that happen to do almost exactly the same things. One I did many months ago and the other is very recent. In both cases, I had data that needed to be available throughout all the functions of the page. Looking at the code, I noticed that in the older one I used a shared variable (woud be static in c#) to hold the needed data. In the newer app, I simply used a session variable. The data itself is a dataTable.
My question is:...Session Variables Vs Session Class
I am rewriting a classic ASP application in .NET using ASP.net and C#.
We used Session Variables to handle storing the current user information throughout the original application. I was wondering what the benefits would be of using a Session Class over Session Variables, and also how I could implement this?
Many thanks in advance for any information you can give me.
Check this out.
I think Session class always beneficial since you have more control over accessing and setting your session variables and exception handling. Check the link for its sample implem...Session variables vs. Session States
What is the difference and in what situations are they used.
A session state (the state of your session) holds your session variables. If your session state expires (due to inactivity) then you lose your session variables...and any other info stored for that session.
If you need to store USER specific information within a web app, then session variables are one(of several) ways to do it.
Is there any code that you could show that would give an example?
example of what? reading and writing session variables?