Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting the productids from main page.

And then filling the grid on the bases of these productids on productcatalog.aspx page.
C#
like..query = "Select * from Products where ProductID in ('" + Request.QueryString["ID"].ToString().Substring(1) +"') AND UnitCost < 5000";

I have a links on mainpage e.g <5000 i.e ( for which above query works) and i have more links e.g between 5000 and 10000 and >10000.

How can I amend the code to work with the same page to execute the last two.

I don't want to make two extra pages for two show the desired products in grid for 5000 and 10000 and >10000.

I want to show them on same page.

What approach I have to made.
Posted
Updated 29-Dec-11 0:48am
v5

1 solution

C#
public void less()
{
/* write the block of code you use for loading data in grid view */
"Select * from Products where ProductID in ('" + Request.QueryString["ID"].ToString().Substring(1) +"') AND UnitCost <5000;
}

now when ever the link with value less than 5000 is clicked, the above method is to Called less();

in similar way create different methods for different links.
and use the same datagridview in each method, so your data will be shown on same gridview.
and clear datagridview before loading the next link

--theanil
 
Share this answer
 
v5
Comments
codegeekalpha 28-Dec-11 17:01pm    
i haven't got that.. :(
theanil 28-Dec-11 17:05pm    
what you haven't got?
theanil 28-Dec-11 17:08pm    
you mean that you didn't understood my solution?
codegeekalpha 28-Dec-11 20:14pm    
yeh
codegeekalpha 28-Dec-11 20:15pm    
please put some more code?

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