stillLearning
stillLearning

Reputation: 84

Didn't pass parameter

I have a problem here. Right now I'm doing my Web Based Application, my coding didn't have any error but got problems. For example, after the user choose any data in combobox, dropdownlist and calendar from database, the user will click 'Report' button. After the user click 'Report' button, it will go to Report page.

Code studDetail.aspx.cs:

if (Date != "" && studNam != "ALL" && subject != "ALL")
{
  Response.Redirect("repStudReport.aspx?Date =" 
                    + Date + "&studNam =" + studNam + "&subject =" + subject);
}

When I debug the coding variable for Date, Student Name and Subject (in studDetail.aspx.cs) are not equal to null which mean that it has value. My problem is, the value from Date, Student Name and Subject (studDetail.aspx.cs) didn't pass to these code (repStudReport.aspx.cs):

Code for repStudReport :

string Date = Request.QueryString["Date"];
string studNam = Request.QueryString["studNam"];
string subject = Request.QueryString["subject"];

Date =null studNam=null and subject=null

Upvotes: 0

Views: 99

Answers (2)

Deepu Madhusoodanan
Deepu Madhusoodanan

Reputation: 1505

Can u check the condition using string is null or empty method

if(string.IsNullOrEmpty(Date))
{

}

Thanks Deepu

Upvotes: 0

shenhengbin
shenhengbin

Reputation: 4294

try this ?

Response.Redirect("repStudReport.aspx?Date=" + Date + "&studNam=" + studNam + "&subject=" + subject);

I think it is because of the space between your parameter name and "="

Upvotes: 2

Related Questions