龙空技术网

asp.net中的html控件和服务器控件及其值的获取

洞悉科学 145

前言:

今天同学们对“html下载控件”可能比较重视,小伙伴们都想要分析一些“html下载控件”的相关内容。那么小编同时在网上搜集了一些有关“html下载控件””的相关内容,希望咱们能喜欢,兄弟们一起来了解一下吧!

一、html表单控件

<input type="radio"  name="nw" value="1" title="内网" checked="" runat="server"><input type="radio" name="nw" value="2" title="外网" runat="server">

获取值:

Request.Form["nw"].ToString()

二、RadioButtonList服务器控件(单选框)

<asp:RadioButtonList ID="RadioButtonList1" runat="server"  RepeatDirection="Horizontal">   <asp:ListItem Value="1" Selected="True">男</asp:ListItem>   <asp:ListItem Value="2">女</asp:ListItem></asp:RadioButtonList>

获取值:

//获取Text的值RadioButtonList1.SelectedItem.Text//获取Value的值RadioButtonList1.SelectedItem.Value

标签: #html下载控件 #html服务器控件