Click here to Skip to main content
15,124,187 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I'm developing a shopping website. My requirement is that when i click on viewdetails(link button) I want to display those
particular details in another page.

Please send this code. Thankyou.
Posted
Updated 9-Nov-11 0:45am
v4
Comments
jim lahey 9-Nov-11 5:42am
   
Have you searched or Googled for a solution?
Tejas Vaishnav 9-Nov-11 5:43am
   
provide correct tags....

Hi,

I hopw you are using datalist for displaying items

that means linkbutton must in datalist control so just like below

ASP.NET
<asp:linkbutton id="fgdfg" runat="server" commandname="viewdet" commandargument="<%#Eval("itemid")" xmlns:asp="#unknown">View Details</asp:linkbutton>


After that you've to handle that linkbutton event by using itemcommand of datalist
C#
//under itemcommand event of datalist
if(e.commandname=="viewdet")
{
   response.redirect("viewdetails.aspx?itemid="+e.commandargument.tostring());
}


By using above code you can send that item id to viewdetails aspx page

in that page you can retrieve data regarding that querystring in pageload
and display it in detailed view

I hopw you understood What I said

All the Best
   
For sending data to other page there is many ways.....

1) use a Querystring for it...
2) Session
3) Cookies

you can use any of this....

1) Query string is used when you need to pass some argument type data to other page like you need to pass any ID or name then you can pass it with use of query string like this...
C#
Response.Redirect("~/test.aspx?ID=1");

and use in test.aspx page like this...
C#
string ID = Request.QueryString["ID"].toString();

http://www.dotnetperls.com/querystring[^]

2) Session is handle to store big amount of data so in your case if you create a data table in your memory for storing items which is user added to its selection and then directly you can add that data table to your session and use in your other page by converting session to data table like this....

C#
//In Your Item Selection Page that is Items.aspx
Session["MyDataTable"] = dt;
Response.Redirect("~/ItemSelectionView.aspx");
//and then use it for displaying item in ItemSelectionView.aspx page
DataTable dt = (DataTable)Session["MyDataTable"];
//then use dt as your display control's datasource..... like this...
GridView1.DataSource = dt;
GridView1.DataBinding();

http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]

3) Or Cookie is used to store data at client side and you can also need to write data in Cookie and while displaying you need to read data from it....
http://msdn.microsoft.com/en-us/library/ms178194.aspx[^]
   

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