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" />
                        <Columns>
                          
                            <asp:ImageField DataImageUrlField="image_name"
                                DataImageUrlFormatString="~/images/items/{0}_th.jpg" ShowHeader="False">
                            </asp:ImageField>
                           
                            <asp:HyperLinkField DataNavigateUrlFields="id, price"
                                DataNavigateUrlFormatString="details.aspx?id={0}&price={1}" DataTextField="name" />
                               
                               
                            <asp:BoundField DataField="price"
                                SortExpression="price" ShowHeader="False" DataFormatString="${0}" />

                        </Columns>
                        <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" />
                    </asp:GridView>

Entry filed under: ASP.NET, Database.

Database connection using the Add Parameter QueryString

發表迴響

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

WordPress.com 標誌

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

Google photo

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

Twitter picture

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

Facebook照片

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

連結到 %s

Trackback this post  |  Subscribe to the comments via RSS Feed


近期文章


%d 位部落客按了讚: