如何在照片窗口中放大图像和显示

时间:2013-04-16 12:56:38

标签: c# asp.net

从gridview中单击图像按钮并将放大图像显示到窗口照片中。

下面是我的代码...实际上它正在工作..但问题是我不知道如何放大图像...谢谢你分享你的知识......我很欣赏......

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        DataKeyNames="P_No" DataSourceID="SqlDataSource1"
        style="margin-left:115px" AllowPaging="True"
        onselectedindexchanged="GridView1_SelectedIndexChanged">
        <Columns>
            <asp:BoundField DataField="P_No" HeaderText="P_No" ReadOnly="True"
                SortExpression="P_No" ItemStyle-BackColor="#FFFF66" ItemStyle-HorizontalAlign="Center"                         
ItemStyle-VerticalAlign="Middle" HeaderStyle-BackColor="#EAEA00" />
            <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" ItemStyle-    
BackColor="#FFFF66" HeaderStyle-BackColor="#EAEA00" />
            <asp:BoundField DataField="Price(Php)" HeaderText="Price(Php)"
                SortExpression="Price(Php)" ItemStyle-BackColor="#FFFF66" HeaderStyle-BackColor="#EAEA00" />
            <asp:BoundField DataField="ImageFilename" HeaderText="ImageFilename"
                SortExpression="ImageFilename" ItemStyle-BackColor="#FFFF66" HeaderStyle-BackColor="#EAEA00" />

        <asp:TemplateField HeaderText="Images" HeaderStyle-BackColor="#EAEA00" >
           <ItemTemplate>
               <!--<asp:Image ID="Image1" Height="50px" Width="60px" runat ="server" ImageUrl='<%#Eval("ImageFilename","~/Images/{0}") %>' /> -->
               <asp:ImageButton ID="ImageButton1" runat="server" Height="50px" Width="60px" ImageUrl='<%#Eval("ImageFilename","~/Images/{0}") %>'   />
          </ItemTemplate>
       </asp:TemplateField>

       </Columns>
    </asp:GridView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
        SelectCommand="SELECT * FROM [DevelopTbl]"></asp:SqlDataSource>

1 个答案:

答案 0 :(得分:0)

您可以使用客户端脚本执行此操作。可以找到示例应用程序here