|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: <asp ataList 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> </asp ataList> --------- <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 |
|
#2
|
||||
|
||||
|
-->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 |
|
#3
|
|||
|
|||
|
simple....
you can use CACHE for this...
C#.. default.aspx: (source page) Cache["myvalue"]= textbox1.text; default2.aspx (destination page) label1.text= Cache["myvalue"]; |
|
#4
|
|||
|
|||
|
Quote:
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> <asp etailsView ID="DetailsView1" runat="server" DataSourceID="AccessDataSource1" Height="50px" Width="125px"> </asp etailsView><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 |
|
#5
|
|||
|
|||
|
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.... |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > General - Question - How to display data from one page to another? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|