Public Variables held in Module

MisterMacro

Newcomer
Joined
Nov 30, 2004
Messages
7
I have a Web Project in which I am holding a few key (Public) variables in a Module. The issue is that when two or more users are on the site or page the variables do not stick with the correct user. One user is getting the others variables. How do I fix this? I do not want to keep passing multiple variables through .aspx pages. That is why I used the module to contain them, but they do not stay with the correct user. Any Ideas? :mad:
 
PlausiblyDamp said:
You may want to consider using Session variables or something similar
Clicky may be worth a read


I actually have that sample. The problem lies within the Datagrid. I use a Hyperlink Column to connect to the other page and that is when all is lost and it assumes the variables of who else is on the site/page.
 
Sounds like your using cache instead of session. No two users will EVER share the same session.
 
bri189a said:
Sounds like your using cache instead of session. No two users will EVER share the same session.

How do you fix something like that? Is there a special setting on the Module itself that states this? I do not want to pass all the variables through the HTML/ASPX. They should be fine sitting as Public Variables on a Module Page but they tend to switch from user to user when 2 or more people are on that site/page. :mad:
 
You will need to use something other than a module, modules are designed to be shared / global.
The methods I suggested before should cover your needs, if you have a problem with a specific piece of code not working then you might be better off posting that here to see if anyone can help.
 
Here is where it falls apart:
HTML CODE:
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Ticket_ID" DataNavigateUrlFormatString="WebForm2.aspx?Ticket_ID={0}"
DataTextField="Ticket_ID" HeaderText="Ticket_ID"></asp:HyperLinkColumn>
<asp:BoundColumn DataField="TICKET_STATUS" HeaderText="Status"></asp:BoundColumn>
<asp:BoundColumn DataField="TICKET_ASSIGNED_TO" HeaderText="Assigned To"></asp:BoundColumn>
<asp:BoundColumn DataField="IS_EMERGENCY" HeaderText="Emergency"></asp:BoundColumn>
<asp:BoundColumn DataField="LAST_STATUS_UPDATE" HeaderText="Last Status Update"></asp:BoundColumn>
<asp:BoundColumn DataField="LAST_STATUS_UPDATE_APP_USER" HeaderText="Last User"></asp:BoundColumn>
<asp:BoundColumn DataField="DIG_NO" HeaderText="Dig No"></asp:BoundColumn>
<asp:BoundColumn DataField="REV" HeaderText="Rev"></asp:BoundColumn>
<asp:BoundColumn DataField="ADDRESS" HeaderText="Address"></asp:BoundColumn>
<asp:BoundColumn DataField="PLACE" HeaderText="City"></asp:BoundColumn>
<asp:BoundColumn DataField="DIG_START" HeaderText="Dig Start"></asp:BoundColumn>
</Columns>

If the Module can not decipher between user then I need to pass the Variable APP_USER along through the Hyperlink. On this page the Variable APP_USER is the value of label1. I do not know if you can pass Label1.text in the HTML code like you can with the VB code.
 
Ok! How about a Compermise?
Server.Transfer("WebForm2.aspx?T1=JACK&T2=JILL")

What is the Syntax to make JACK Textbox.text and JILL Textbox2.text?
I have tried but I can only get one variable across.
 
Server.Transfer("WebForm2.aspx?T1=" & TextBox1.Text)
The Above code works with One Varaible, the contents of Textbox1

Server.Transfer("WebForm2.aspx?T1=" & TextBox1.Text & "T2=" & TextBox1.Text)
This code doesn't because it treats T2= as string and attaches it to the value of Textbox1

If I remove the "" or use + it errors in Syntax. How to I pass the values of Textbox1 into T1 and the value of Textbox2 into T2 and get it to format/Syntax correctly like
Server.Transfer("WebForm2.aspx?T1=JACK&T2=JILL")
 
Server.Transfer("WebForm2.aspx?T1=" & TextBox1.Text)
The Above code works with One Varaible, the contents of Textbox1

Server.Transfer("WebForm2.aspx?T1=" & TextBox1.Text & "T2=" & TextBox1.Text)
This code doesn't because it treats T2= as string and attaches it to the value of Textbox1

If I remove the "" or use + it errors in Syntax. How to I pass the values of Textbox1 into T1 and the value of Textbox2 into T2 and get it to format/Syntax correctly like
Server.Transfer("WebForm2.aspx?T1=JACK&T2=JILL")
 
Back
Top