摘要载入中… 请稍等…
内容载入中… 请稍等…
| Protected Sub Page_Load(Src As Object, E As EventArgs) DataBind() End Sub |
| <script language="VB" runat="server"> Sub SubmitBtn_Click(sender As Object, e As EventArgs) Page.DataBind End Sub </script> <B>帮韦小宝选择一个老婆</B> <form runat=server> <asp:DropDownList id= "StateList" runat="server"> <asp:ListItem>阿珂</asp:ListItem> <asp:ListItem>曾柔</asp:ListItem> <asp:ListItem>建宁</asp:ListItem> <asp:ListItem>沐公主</asp:ListItem> <asp:ListItem>双儿</asp:ListItem> <asp:ListItem>教主夫人</asp:ListItem> </asp:DropDownList> <asp:button Text= "Submit" OnClick="SubmitBtn_Click" runat=server/> <p> 您帮韦小宝选择的老婆是 : <asp:label text='<%# StateList.SelectedItem.Text %>' runat=server/> </form> |
我们看到,那个选择老婆的地方没有使用什么控件,但是他却能正确的显示我们的选择结果,这个是就捆绑的结果,注意<%# StateList.SelectedItem.Text %>这句话,正是它让我们取得了捆绑的数据。
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |