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

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

\


二、使用 FormView控件编辑数据
1、编辑EditItemTemplate模板,代码如下:
[html]
<EditItemTemplate> 
                <table border="0" cellpadding="0" cellspacing="0" width="420"> 
                    <tr> 
                        <td colspan="6" height="30" width="420" align="center"> 
                        <h4>FormView EditItemTemplate 模板</h4> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td width="30"> 
                        </td> 
                        <td rowspan="4" width="120"> 
                            <asp:Image ID="imgItem" runat="server" AlternateText="上传浏览图片" Height="120px" ImageUrl='<%# Eval("Image") %>' 
                                Width="120px" /></td> 
                        <td width="30"> 
                        </td> 
                        <td colspan="2"> 
                            <asp:FileUpload ID="fupImage" runat="server" Width="100%" /></td> 
                        <td width="60"> 
                            <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="上传" /></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 © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,