Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have a url

/localhost/GoldenEye/Web/Reports.aspx?ExamName=Mid Term Exam&CourseId=7&SubjectId=28

now in my page i have a gridview now i want to use this 3 values and i want to show the gridview filtered by the above url values.

can any one help me?
Posted
Comments
Thanks7872 1-Jan-15 2:19am    
Than get values from url :get query string in c#,pass it to there from where you are getting data for GridView. What is the issue here?
Member 11099119 1-Jan-15 2:23am    
sry i dont know how to get the values from url
i am new to the software
Thanks7872 1-Jan-15 2:27am    
That is why i already gave you link to learn it. Go through it.
Member 11099119 1-Jan-15 4:59am    
thank u i solved the problem

please check ..

httprequest.querystring()[^]
 
Share this answer
 
C#
string examName = string.Empty;
string courseId = string.Empty;
string subjectId = string.Empty;

if (!String.IsNullOrEmpty(Request.QueryString["ExamName"]))
{ 
// Query string value is there so now use it
    examName = Convert.ToString(Request.QueryString["ExamName"]);
}
if (!String.IsNullOrEmpty(Request.QueryString["CourseId"]))
{ 
    courseId = Convert.ToString(Request.QueryString["CourseId"]);
}
if (!String.IsNullOrEmpty(Request.QueryString["SubjectId"]))
{
    subjectId = Convert.ToString(Request.QueryString["SubjectId"]);
}

//Now use this strings as per your requirements for filtering 
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900