1、 DropDownList 的赋值
Response.Write(DropDownList1.Items.FindByText("潍坊").Value);
Response.Write(DropDownList1.Items.FindByValue("0536").Text);
Response.Write(DropDownList1.SelectedItem.Value);
2、GridView 模板列取值
<asp:TemplateField HeaderText="场点" InsertVisible="False" SortExpression="examroom_name">
<asp:Label ID="Labpexamroom_name" ToolTip='<%#Eval("examroom_name")%>' runat="server" Text='<%#DotNet.Common.StringHelper.CutString(DataBinder.Eval(Container.DataItem, "examroom_name").ToString(),16,true)%>'></asp:Label>
</asp:TemplateField>
protected void Button1_Click(object sender, EventArgs e)
{
for (int i=0; i< GVListShow.Rows.Count; i++)
{
((Label)GVListShow.Rows[i].FindControl("Labpexamroom_name")).Text = "44445";
}
}