GridView绑定

问题描述:

//< asp:Gridview/>
之后

// after <asp:Gridview />

<columns>
                            <asp:BoundField DataField="SrNo" Visible="false" ItemStyle-ForeColor="Black">
                            <asp:BoundField DataField="Name" HeaderText="NAME" ItemStyle-ForeColor="Black">
                            <asp:BoundField DataField="Birth" HeaderText="BIRTH" ItemStyle-ForeColor="Black">
                            
                            <asp:BoundField DataField="Age" HeaderText="AGE" ItemStyle-ForeColor="Black">
                            <asp:TemplateField HeaderText="EDIT?">
                                <itemtemplate>
                                    <asp:LinkButton ID="lnkEdit" ForeColor="black" CommandName="Edit" CommandArgument='<%# Eval("SrNo") %>'

                                        runat="server" Text="Edit">
                                    
                                </itemtemplate>
                            
                            <asp:TemplateField HeaderText="DELETE?">
                                <itemtemplate>
                                    <asp:LinkButton ID="lnkDelete" OnClientClick="return confirm('Are you sure, you want to delete Record?');return false;"

                                        ForeColor="black" CommandName="Delete" CommandArgument='<%# Eval("SrNo") %>'

                                        runat="server" Text="Delete">
                                    
                                </itemtemplate>
                            
                        </columns>

是的,HTML看起来不错,但gridview绑定将需要更多代码来显示结果!

您需要付出更多的努力,并建议您停止出现此类问题的论坛.请尝试并具体说明发布问题.
Yes the HTML looks ok but the gridview bind would need more code to show result!

You need to make more effort and would suggest you to stop flooding forum with such questions. Please try and be specific in posting issues.


没有问题,并从标题中删除了((是对的))".我们无法告诉您您的代码是否正确",因为我们没有(也不想要)您的所有代码.如果可以编译,请在调试器下运行它.如果不正确,您很快就会知道.
Not a question, and removed "(Is it right)" from title. We can''t tell you if your code is "right", because we don''t have (nor do we want) all of your code. If it compiles, run it under the debugger. If it''s not right, you''ll know in short order.