在Web应用程序根目录下的admin目录中有一个页面first.aspx,单击页面中的Button按钮跳转到同一目录下的second.aspx页面,下列代码错误的是:____
A: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("./second.aspx");}
B: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("~/admin/second.aspx");}
C: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("/admin/second.aspx");}
D: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("second.aspx");}
A: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("./second.aspx");}
B: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("~/admin/second.aspx");}
C: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("/admin/second.aspx");}
D: private void Button1_Click(object sender, System.EventArgs e){
Server.Transfer("second.aspx");}
举一反三
- 双击一个名为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){ }
- 中国大学MOOC: 在asp.net中,有一个aspx页面的部分代码如下,当用户单击Button1按牛后,下列说法正确的是()。Public class CityBrower:System.Web.UI.Page{ Protected System..Web.UI.WebControls.Button Button1; String name=”ASP.NET3.0”: Private voidPage_Load(object sender,System.EventArgs e) { If(!this.IsPostBack) { Name = “ASP.NET4.0”; } Response.Write(name);}Private void Button1_Click(object sender,System.EventArgs e){ Name = “ASP.NET5.0”;}}
- 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 + "!"; } }
- 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); } }
- 在一个ASPX页面的Page_Load事件中,编写代码,private void Page_Load(object sender,System.EventArgs e) { Response.Write(“欢迎光临”);Response.End();Response.Write(“欢迎下次光临”);}则执行该页面后,将在页面中输出: