扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:陶刚编译 来源:天极开发 2007年11月6日
关键字: Windows
<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" DataKeyNames="PhotoID"> <EditItemTemplate> <b>Enter a New Caption:</b> <asp:TextBox Text='<%# Bind("Caption") %>' runat="server" ID="CaptionTextBox" /> <asp:Button ID="Button1" runat="server" Text="Update" CommandName="Update" /> <asp:Button ID="Button2" runat="server" Text="Cancel" CommandName="Cancel" /> </EditItemTemplate> <ItemTemplate> <asp:Label ID="CaptionLabel" runat="server" Text='<%# Eval("Caption") %>' Font-Size="32pt" /><br /> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("FileName", "images/{0}") %>' /> <br /> <asp:Button ID="Button3" runat="server" Text="Edit Caption..." CommandName="Edit" /> <asp:HyperLink ID="HyperLink1" Text="Back to Album" NavigateUrl='<%# Eval("AlbumID", "PhotosDataList.aspx?ID={0}") %>' runat="server" /> </ItemTemplate> </asp:FormView> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataComponentTableAdapters.PhotosTableAdapter" SelectMethod="GetPhoto" UpdateMethod="UpdateCaption" OldValuesParameterFormatString="original_{0}"> <UpdateParameters> <asp:Parameter Name="Caption" /> <asp:Parameter Name="Original_PhotoID" /> </UpdateParameters> <SelectParameters> <asp:QueryStringParameter Name="PhotoID" DefaultValue="9" QueryStringField="ID" /> </SelectParameters> </asp:ObjectDataSource> |
…… <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" DataKeyNames="AlbumID"> <Columns> <asp:CommandField ShowEditButton="True" /> <asp:BoundField ReadOnly="True" HeaderText="AlbumID" DataField="AlbumID" SortExpression="AlbumID" /> <asp:TemplateField HeaderText="AlbumName" SortExpression="AlbumName" ItemStyle-Wrap="false"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("AlbumName") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("AlbumName") %>'></asp:TextBox> <asp:RequiredFieldValidator ControlToValidate="TextBox1" ErrorMessage="AlbumName cannot be empty" ID="RequiredFieldValidator1" Display="Dynamic" runat="server">*</asp:RequiredFieldValidator> </EditItemTemplate> </asp:TemplateField> …… </asp:GridView><br /> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" ConvertNullToDBNull="true" TypeName="DataComponentTableAdapters.AlbumsTableAdapter" SelectMethod="GetAlbumsByOwner" UpdateMethod="Update" OldValuesParameterFormatString="original_{0}"> …… </asp:ObjectDataSource> |
<asp:TemplateField HeaderText="Owner" SortExpression="Owner"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Eval("Owner") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList DataSourceID="ObjectDataSource2" DataTextField="Owner" DataValueField="Owner" ID="DropDownList2" runat="server" SelectedValue='<%# Bind("Owner") %>'> </asp:DropDownList> </EditItemTemplate> <ItemStyle Wrap="False" /> </asp:TemplateField> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者