Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
okk first of all i know about qury string overview is that query string is use to post some value of one page to another page....okk its fine
now i m creating one CMS website now in that i have one menu link named PRODUCTS now click on this it will show all the products in perticular table format ...now my point is when click of perticular image of this product it will post to another page and it will show large image with technical description of this product so in URL it is shown like http:\\www.xyz.com\Products.aspx?Id=1234 now i want hint of coding for this things..how i can generate Id in url it willl come from database value ?? please give me some hints .....thank u
Posted 21-Feb-13 9:37am
Edited 21-Feb-13 9:56am
v2
Comments
Sergey Alexandrovich Kryukov at 21-Feb-13 14:42pm
   
C and ASP.NET? How is it?
—SA
pandya purvang at 21-Feb-13 14:48pm
   
sorry its c# and asp.net
Sergey Alexandrovich Kryukov at 21-Feb-13 14:55pm
   
Can you see "Improve question" on top? :-)
—SA
pandya purvang at 21-Feb-13 14:57pm
   
yes sir ...but if any one give me some hint then it is also very helpfull to me ..
ryanb31 at 21-Feb-13 15:04pm
   
You just need to read the data from the database and put it onto the querystring. Maybe if you posted some relevant code we can be more specific.
pandya purvang at 21-Feb-13 15:08pm
   
sir right now i m on the statge of R&D so i m doing research so pls give some coding idea about this type of requirement
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I suggest you to start here: ASP.NET Tutorial[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi, Use datalist to show your product images, datalist have property that 'DataKeyField' set this property is equal to your ProductId, and use ItemCommand Event to go to the Product details page.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Its probably best to use UrlEncode[^] with your query string. This encodes the string during transmissions and protects from injection attacks.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Dear Pandya
It seems that you have problem in to fetch the data from database and forward it to the next page with the use of Query String
So for that purpose firstly bind your data in ListView(I am taking an example with the help of Eval)
Suppose From your requirement There is and product id(From DB) Which you want to take with your page
So
<asp:listview id="list" runat="server" groupitemcount="1" xmlns:asp="#unknown">
        EnableModelValidation="True">
    <emptydatatemplate>
        No Data Is Available Right Now
    </emptydatatemplate>
    <layouttemplate>
        <table>
            <tr runat="server" id="groupPlaceholder" />
        </table>
    </layouttemplate>
    <grouptemplate>
        <tr>
            <td runat="server" id="itemPlaceholder" />
        </tr>
    </grouptemplate>
    <itemtemplate>
       <tr>
            <td colspan="2">
                 <a href="Preview.aspx?articleid=<%# Eval(" product_id=") %>">
           <asp:label id="title" runat="server" text="<%# Eval("Title") %>" />
                     </a>
                </td>
           </tr>
           <tr>
           <td colspan="2">
          
    </td></tr></itemtemplate>
</asp:listview>
Do not forget to bind this list view in code behind
Hope You got the solution
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100