-3

当您从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>
4

1 回答 1

0

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

于 2013-04-16T13:06:06.730 回答