Querystring and asp.net

R

Rick

Hi guys i have a problem with a page

I've made a little system to show products and who has bought each item, my
problem is this:

i have a page Customer.aspx and Report.aspx

Customer.aspx executes a javascript to show Report.aspx

the code is

protected void btnCA_Click(object sender, EventArgs e)

{

String strPop = "<script language='javascript'>" +
"window.open('rptSales.aspx?usuario=" + giUsuario.ToString() + "&nombre=" +
gsNombre + "','Report" + giUsuario.ToString() +
"','location=no,scrollbars=yes');</script>";

ClientScript.RegisterStartupScript(GetType(), "SalesReport" +
giUsuario.ToString(), strPop);

}

usuario=" + giUsuario.ToString() <--- here i send the user code using
Querystring

but if 2 or more users are logged at same time, the Report.aspx page shows
the second user items (or last logged user), why??? i'm sending the correct
user code but when more than one user are logged always the page shows last
user logged items

any idea??

PS: i also tried with cookies and got the same problem... =(
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

The code isn't showing the Report.aspx page at all. It's showing the
rptSales.aspx page.

Where does the value in giUsuario come from?

Are you using the querystring in the rptSales.aspx page at all?
 
H

Hans Kesting

Hi guys i have a problem with a page
I've made a little system to show products and who has bought each item, my
problem is this:

i have a page Customer.aspx and Report.aspx

Customer.aspx executes a javascript to show Report.aspx

the code is

protected void btnCA_Click(object sender, EventArgs e)

{

String strPop = "<script language='javascript'>" +
"window.open('rptSales.aspx?usuario=" + giUsuario.ToString() + "&nombre=" +
gsNombre + "','Report" + giUsuario.ToString() +
"','location=no,scrollbars=yes');</script>";

ClientScript.RegisterStartupScript(GetType(), "SalesReport" +
giUsuario.ToString(), strPop);

}

usuario=" + giUsuario.ToString() <--- here i send the user code using
Querystring

but if 2 or more users are logged at same time, the Report.aspx page shows
the second user items (or last logged user), why??? i'm sending the correct
user code but when more than one user are logged always the page shows last
user logged items

any idea??

PS: i also tried with cookies and got the same problem... =(

You didn't specify what giUsuario is, but I bet it's a static variable
somewhere. You can't use statics this way in ASP.Net, as it is a single
application that serves multiple concurrent users.
You might want to store those values in Session.
Session["giUsuario"]

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top