Hi guys, i used usercontrol in my home page,in that page like LCD,Comuters,Laptops like there are different types of categories are there.how can i retrive the exact product from the databse.my code is bellow.
in default.aspx.cs :-
if (Request.QueryString["ProductName"] == "laptop")
{
//sql = "select * from Products where CategoryID=10 and Productname like'"+dell+"'";
string cid = Request.QueryString["CategoryID"].ToString();
string categ = "Laptops";
sql = "select * from Products where (CategoryID='" + cid + "') and ((ProductName like '" + categ.ToString() + "%') or (ProductName like '" + notebook + "%'))";
viewdata(sql);
}
I passed querystring in usercontrlo like this.
<td height="18" align="left" valign="top" background="images/pole_2a.jpg">
<div style="padding-left: 12px; padding-top: 0px">
<a href="Default.aspx?CategoryID=10&ProductName=laptop" class="style7" style="text-decoration: none">
Laptops & Notebooks</a></div>
</td>
but it is not working for me.
if any body knows plz help me,Thanks in advance.