扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
<asp:DetailsView…...> <Fields> <asp:BoundField DataField="Phone" HeaderText="Phone" NullDisplayText="not listed" SortExpression="Phone" /> <asp:BoundField DataField="Fax" HeaderText="Fax" NullDisplayText="not listed" SortExpression="Fax" /> </Fields> <EmptyDataTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/warning.gif" />There are no records to display </EmptyDataTemplate> </asp:DetailsView> <asp:SqlDataSource ……> <UpdateParameters> <asp:Parameter Name="ContactTitle" Type="String" DefaultValue="Owner" ConvertEmptyStringToNull="true" /> <asp:Parameter Name="Region" Type="String" ConvertEmptyStringToNull="true" /> <asp:Parameter Name="Phone" Type="String" ConvertEmptyStringToNull="true" /> <asp:Parameter Name="Fax" Type="String" ConvertEmptyStringToNull="true" /> <asp:Parameter Name="CustomerID" Type="String" /> </UpdateParameters> …… </asp:SqlDataSource> |
<asp:DropDownList AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="state" DataValueField="state" ID="DropDownList1" runat="server"> <asp:ListItem Value="">ALL</asp:ListItem> </asp:DropDownList> <asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:Pubs %>" ID="SqlDataSource2" runat="server" SelectCommand="SELECT DISTINCT [state] FROM [authors]"> </asp:SqlDataSource> <asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:Pubs %>" ID="SqlDataSource1" runat="server" SelectCommand="SELECT au_id, au_lname, au_fname, state FROM authors WHERE state = IsNull(@state, state)" CancelSelectOnNullParameter="False"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="state" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource> |
婵″倹鐏夐幃銊╂姜鐢瓕鎻╅崚鍥╂畱閹厖绨$憴顤廡妫板棗鐓欓張鈧弬棰侀獓閸濅椒绗岄幎鈧張顖欎繆閹垽绱濋柇锝勭疄鐠併垽妲勯懛鎶姐€婄純鎴炲Η閺堫垶鍋栨禒璺虹殺閺勵垱鍋嶉惃鍕付娴f娊鈧柨绶炴稊瀣╃閵嗭拷