请教一下大侠 做了个注册实验的
就是我托了两个panel控件 第一个我设为true 第二个设为false 然后再后台写上这样的代码
protected void btntext3_Click(object sender, EventArgs e)
{
if (this.IsValid)
{
this.Panel3.Visible = false;
this.Panel4.Visible =true;
}
当单击下一步时 第二个panel出来
请各位师傅指点指点 谢谢!!!!!
就是我托了两个panel控件 第一个我设为true 第二个设为false 然后再后台写上这样的代码
protected void btntext3_Click(object sender, EventArgs e)
{
if (this.IsValid)
{
this.Panel3.Visible = false;
this.Panel4.Visible =true;
}
当单击下一步时 第二个panel出来
请各位师傅指点指点 谢谢!!!!!
解决方案 »
- 一个复杂的表格
- 数据绑定
- VS2005,关于WEB.CONGIG,在生成网站时web.config出现如下22个消息,错在哪里?
- 用InstallShield 10.5怎样修改配置文件!!!急
- 哪位兄台知道xml spy 2004 enterprise的注册码?
- 问个开发流程问题。。。(在线。。。)
- EXCEL导出的时候, 当用户连续点击导出按钮二次以上的时候, 就会出错!
- gridview模板列中的textbox要绑定数据,数据源非要用sqldatasource么?
- datalist 模板
- 谁能给我讲讲XML的具体用法
- 为什么
- 怎么在新打开的窗口双击gridview,返回先前页,把选中行的值传给gridview并刷新?
=>
Page.IsValid
点击按钮肯定要隐藏。在阐述一下你的问题4个panel想要什么效果。比如点击 呈现几个隐藏几个。。
截至 2011-04-05 16:27:55 前:
你已发帖 5 个, 未结贴 5 个;
结贴率为: 0.00%当您的问题得到解答后请及时结贴.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html如何给分和结贴?
http://community.csdn.net/Help/HelpCenter.htm#结帖如何给自己的回帖中也加上签名?
http://blog.csdn.net/q107770540/archive/2011/03/15/6250007.aspx
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server">
1
</asp:Panel>
<asp:Panel ID="Panel2" runat="server">
2
</asp:Panel>
<asp:Panel ID="Panel3" runat="server">
3
</asp:Panel>
<asp:Panel ID="Panel4" runat="server">
4
</asp:Panel>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
后台
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;namespace QuestionForCsdn
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
this.Panel3.Visible = false;
this.Panel4.Visible = false;
}
} protected void Button1_Click(object sender, EventArgs e)
{
if (this.Panel1.Visible == false && this.Panel2.Visible == false && this.Panel3.Visible == false && this.Panel4.Visible == false)
{
this.Panel1.Visible = true;
this.Panel2.Visible = false;
this.Panel3.Visible = false;
this.Panel4.Visible = false;
}
else if (this.Panel1.Visible == true && this.Panel2.Visible == false && this.Panel3.Visible == false && this.Panel4.Visible == false)
{
this.Panel1.Visible = false;
this.Panel2.Visible = true;
this.Panel3.Visible = false;
this.Panel4.Visible = false;
}
else if (this.Panel1.Visible == false && this.Panel2.Visible == true && this.Panel3.Visible == false && this.Panel4.Visible == false)
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
this.Panel3.Visible = true;
this.Panel4.Visible = false;
}
else if (this.Panel1.Visible == false && this.Panel2.Visible == false && this.Panel3.Visible == true && this.Panel4.Visible == false)
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
this.Panel3.Visible = false;
this.Panel4.Visible = true;
}
else
{
this.Panel1.Visible = false;
this.Panel2.Visible = false;
this.Panel3.Visible = false;
this.Panel4.Visible = false;
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class panaltest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void rbtntext_Click(object sender, EventArgs e)
{
if (rbtnagree.Checked)
{
this.Panel1.Visible = false;
this.Panel2.Visible = true;
}
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
string textusername = args.Value;
if (dbcon.judge(textusername))
{
//存在
args.IsValid = false; }
else
{
args.IsValid = true;
} }
protected void btnNext_Click(object sender, EventArgs e)
{
if (this.IsValid)
{
this.Panel2.Visible = false;
this.Panel3.Visible = true; }
}
protected void btnload_Click(object sender, EventArgs e)
{
this.FileUpload1.PostedFile.SaveAs(Server.MapPath("upfile") + "\\9.jpg");
this.Image1.ImageUrl = Server.MapPath("upfile") + "\\9.jpg";
} protected void btntext3_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
this.Panel3.Visible = false;
this.Panel4.Visible =true;
}
} protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("注册成功");
}
}
随便请你解释一下这段代码:this.FileUpload1.PostedFile.SaveAs(Server.MapPath("upfile") + "\\9.jpg");
this.Image1.ImageUrl = Server.MapPath("upfile") + "\\9.jpg";
尤其是 "\\9.jpg";
这个是我的代码 请你看哈 谢谢