pass value in query string via grid view

27 五月, 2009 at 12:08 下午 發表留言

pass value in query string via grid view 

and change the format for the value, and add image ~~

<asp:GridView ID="GridView1″ runat="server" AutoGenerateColumns="False"
                        DataKeyNames="id" DataSourceID="AccessDataSource1″ CellPadding="4″
                        ForeColor="#333333″ GridLines="None" ShowHeader="False">
                        <RowStyle BackColor="#EFF3FB" />
                            <asp:ImageField DataImageUrlField="image_name"
                                DataImageUrlFormatString="~/images/items/{0}_th.jpg" ShowHeader="False">
                            <asp:HyperLinkField DataNavigateUrlFields="id, price"
                                DataNavigateUrlFormatString="details.aspx?id={0}&price={1}" DataTextField="name" />
                            <asp:BoundField DataField="price"
                                SortExpression="price" ShowHeader="False" DataFormatString="${0}" />

                        <FooterStyle BackColor="#507CD1″ Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1″ Font-Bold="True" ForeColor="#333333″ />
                        <HeaderStyle BackColor="#507CD1″ Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />

Entry filed under: ASP.NET, Database.

Database connection using the Add Parameter QueryString


在下方填入你的資料或按右方圖示以社群網站登入: 標誌

您的留言將使用 帳號。 登出 /  變更 )

Google photo

您的留言將使用 Google 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )


您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s

Trackback this post  |  Subscribe to the comments via RSS Feed


%d 位部落客按了讚: