如何在其他页面上使用session传递slq表名 [英] how to pass slq table name using session on other page

查看:111
本文介绍了如何在其他页面上使用session传递slq表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我的页面名称为glass.aspx,shirt.aspx。这些页面包含图像。当任何人点击图片时,他们会重定向到product.aspx页面。 Product.aspx包含图像的所有细节。



产品代码product.aspx



Hello

I have pages name glass.aspx, shirt.aspx. these pages contain images. When any one click on image, they redirect to product.aspx page. Product.aspx contain all details of the image.

My code of product.aspx

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
           ConnectionString=";Password="
           ProviderName="System.Data.SqlClient"
           SelectCommand="SELECT [id],[ImagePath],[ImageName],[details],[price] FROM [BestSherwani] WHERE ([id] = @id)">

           <SelectParameters>
               <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Decimal" />
           </SelectParameters>

           </asp:SqlDataSource>


       <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
           <ItemTemplate>
               <asp:Image ID="Image1" runat="server" Width="200px" Height="300"
                    ImageUrl='<%# Eval("ImagePath", "~/admin/{0}") %>' /><br />


            <asp:Label ID="ImageUrlLabel" Font-Size="XX-Large" runat="server" ForeColor="Red" Text='<%# Eval("ImageName") %>' Visible="False"></asp:Label><br />

               <asp:Label ID="DescriptionLabel" Font-Size="XX-Large" runat="server" ForeColor="Red" Text='<%# Eval("details") %>'></asp:Label><br />--%>
               <asp:Label ID="PriceLabel" Font-Size="XX-Large" runat="server" ForeColor="Red" Text='<%# Eval("price", "{0:##0.00}" ) %>'></asp:Label><br />--%>
               <br />
               <br />
           </ItemTemplate>
       </asp:DataList>





我想在任何一个图像上点击任何图像时传递以下代码的会话



I want to pass session on below code when every any one click on any image

SelectCommand="SELECT [id],[ImagePath],[ImageName],[details],[price] FROM [ SESSION PASS ] WHERE ([id] = @id)

推荐答案

使用 SessionParameter Class [ ^ ]。


你好



请在下面找到答案的URL



点击这里


这篇关于如何在其他页面上使用session传递slq表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆