当前位置:编程学习 > asp >>

FormView显示、更新、插入、删除数据库操作[ASP.NET源代码](三)

\


三、使用 FormView控件更新数据

1、编辑InsertItemTemplate模板,代码如下:

[html] <InsertItemTemplate> 
                <table border="0" cellpadding="0" cellspacing="0" width="420"> 
                    <tr> 
                        <td colspan="6" height="30" width="420" align="center"> 
                        <h4>FormView InsertItemTemplate 模板</h4> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td width="30"> 
                        </td> 
                        <td rowspan="4" width="120"> 
                            <asp:Image ID="imgItem" runat="server" Width="120px" Height="120px" ImageUrl='<%# Eval("Image") %>' 
                                AlternateText="上传浏览图片" /></td> 
                        <td width="30"> 
                        </td> 
                        <td colspan="2"> 
                            <asp:FileUpload ID="fupImage" runat="server" Width="100%"/></td> 
                        <td width="60"> 
                            <asp:Button ID="btnUpload" Text="上传" OnClick="btnUpload_Click" runat="server"></asp:Button></td> 
                    </tr> 
                    <tr> 
                        <td width="30"> 
                        </td> 
                        <td width="30"> 
                        </td> 
                        <td width="60"> 
                            分类:</td> 
                        <td width="120"> 
                            <asp:DropDownList ID="ddlCategory" runat="server" DataSourceID="sdsCategory" DataTextField="Name" 
                                DataValueField="CategoryId"> 
                            </asp:DropDownList></td> 
                        <td width="60"> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td width="30"> 
                        </td> 
                        <td width="30"> 
                        </td> 
                        <td width="60"> 
                            名称:</td> 
         &

补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,