protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["password"] != __________)
this.TextBox2.Attributes.Add("value", Request["password"]);
}
protected void Button1_Click(object sender, EventArgs e)
{
if (CheckBox1.__________)
{
Response.Cookies["password"]. __________= TextBox2.Text;
Response.Cookies["password"]. __________= DateTime.Now.AddSeconds(20);
}
}
{
if (Request.Cookies["password"] != __________)
this.TextBox2.Attributes.Add("value", Request["password"]);
}
protected void Button1_Click(object sender, EventArgs e)
{
if (CheckBox1.__________)
{
Response.Cookies["password"]. __________= TextBox2.Text;
Response.Cookies["password"]. __________= DateTime.Now.AddSeconds(20);
}
}
举一反三
- public partial class MasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { __________.Text = "欢迎您!"; } } public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Label labelname = (Label)__________.__________("Label1"); __________.Text = "欢迎" + TextBox1.Text + "!"; } }
- .NET框架提供有专门的委托类EventHandler,原型如下: A: public delegate void EventHandler(object sender, EventArgs e); B: public delegate void EventHandler(EventArgs e, object sender); C: public event void EventDelegate(object sender, EventArgs e); D: public event void EventDelegate(EventArgs e, object sender);
- 双击一个名为btnCom的按钮,自动生成的鼠标点击事件处理方法为: A: private void btnCom_Click(object sender, EventArgs e){ } B: public void btnCom_Click(object sender, EventArgs e){ } C: private void btnCom(object sender, EventArgs e){ } D: public void btnCom(object sender, EventArgs e){ }
- protected void Page_Load(object sender, EventArgs e) { Response.Write(Server .__________("<h3>三级标题</h3>")); Response.Write("<__________>"); Response.Write(Server.__________("<h3>三级标题</h3>")); }
- 如已有一个委托声明为:public delegate int myCallBack(Object sender,EventArgs e);则用该委托可以调用下面哪个方法( ) A: int receive(Object sender,EventArgs e) {……} B: void myCallBack(Object sender,EventArgs e){……} C: string receive(int x) {……} D: int myCallBack(int x,int y){……}