.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 8th, 2008, 12:43 PM
orchida orchida is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 orchida User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 39 sec
Reputation Power: 0
General - Question - How to display data from one page to another?

Hi i have a page where i use DataList from where display images and names. I have made the names to be link buttons and after clicking on them to redirect the user to go to new page where i want details of that picture to be displayed from the database. the code i have got so far is sending the user to the next page but doesn't display anything on the child page.... Please tell me how to display data on the second page. Thanks

here is the code:

<aspataList ID="DataList1" RepeatColumns="2" DataSourceID="AccessDataSource1" runat="server">
<ItemTemplate>
<br />
<asp:image id="Image" CssClass="PTImage" runat=server src='<%# Eval("Picture") %>' title='<%# Eval("PTName") %>' Visible=true />

<br />

<asp:LinkButton ID="LinkButton1" runat=server Text=<%#Eval("PTName")%> OnClick="RedirectPage"
CommandArgument='<%# String.Concat("PTDetail.aspx?PTName=" & Eval("PTName")) %>'></asp:LinkButton>

</ItemTemplate>
</aspataList>


---------

<script runat=server>
Public Sub RedirectPage(ByVal sender As Object, ByVal E As EventArgs)

Response.Redirect(CType(sender, LinkButton).CommandArgument, True)

End Sub
</script>

please help! thanks

Reply With Quote
  #2  
Old May 8th, 2008, 12:45 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
Click here for more information.
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,813 mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)mehere User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 1 h 18 m 54 sec
Reputation Power: 1567
-->Thread moved to .NET Forum
__________________
Come JOIN the party!!!

Quote of the Month:
Risks: If you never try anything new, you'll miss out on many of life's great disappointments.

Questions to Ponder:
Is there another word for synonym?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
  #3  
Old May 12th, 2008, 05:38 AM
Saif Sarwer Saif Sarwer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 18 Saif Sarwer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 38 m 14 sec
Reputation Power: 0
simple....

you can use CACHE for this...

C#..
default.aspx: (source page)
Cache["myvalue"]= textbox1.text;

default2.aspx (destination page)

label1.text= Cache["myvalue"];

Reply With Quote
  #4  
Old May 12th, 2008, 07:38 AM
orchida orchida is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 orchida User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 39 sec
Reputation Power: 0
Quote:
Originally Posted by Saif Sarwer
you can use CACHE for this...

C#..
default.aspx: (source page)
Cache["myvalue"]= textbox1.text;

default2.aspx (destination page)

label1.text= Cache["myvalue"];


Thank you for the answer. All works fine it passes information to the second page... now the problem is that when i click on record 2 for example on the second page it shows details for record one only... and that's the same for all other records. Do you know how to resolve this issue. I am using asp.net code... here is the code:


page 1:

<asp:AccessDataSource ID="AccessDataSource1"
runat="server" DataFile="~/test.mdb"
SelectCommand="SELECT [PTName], [Picture] FROM [PTTrainers]">
</asp:AccessDataSource>



<br /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="PTName" DataSourceID="AccessDataSource1">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="PTName"
DataNavigateUrlFormatString="~/Default2.aspx?PTName={0};"
DataTextField="PTName" />
<asp:ImageField DataAlternateTextField="Picture" DataImageUrlField="Picture">

</asp:ImageField>

</Columns>
</asp:GridView>

page 2:

<%@ OutputCache Duration="5" VaryByParam="*" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form runat=server>


<aspetailsView
ID="DetailsView1"
runat="server"
DataSourceID="AccessDataSource1"
Height="50px"
Width="125px">
</aspetailsView>


<asp:AccessDataSource
ID="AccessDataSource1"
runat="server"
DataFile="~/test.mdb"
SelectCommand="SELECT [PTName] FROM [PTTrainers]">

<SelectParameters >
<asp:QueryStringParameter
name="PTName"
Type=string QueryStringField="PTName"
/>

</SelectParameters>

</asp:AccessDataSource>



thanks

Reply With Quote
  #5  
Old May 13th, 2008, 04:28 AM
Saif Sarwer Saif Sarwer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 18 Saif Sarwer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 38 m 14 sec
Reputation Power: 0
Hi,

You have to regularly update the CACHE....with the required information.....first time when u save anything in cache...it will remain there till the application runs..so you need to update the cache for each records....
Hope this may solve your problem....

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > General - Question - How to display data from one page to another?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway