ViewState["a"] = "dsds"; string a = ViewState["a"] as string;
3
2
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableViewState="false"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>无标题页</title> </head> <body> <form id="form1" runat="server"> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> </asp:DropDownList> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> </form> </body> </html>
<select name="DropDownList1" id="DropDownList1"> <option value="2">2</option> <option selected="selected" value="3">3</option> <option value="4">4</option> </select>
21
posted on 2011-08-28 21:38 Snowberg 阅读(1020) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 Snowberg Powered by .NET 8.0 on Kubernetes