请教一下大侠  做了个注册实验的   
      就是我托了两个panel控件  第一个我设为true  第二个设为false  然后再后台写上这样的代码
  
 protected void btntext3_Click(object sender, EventArgs e)
    {
        if (this.IsValid)
        {
            this.Panel3.Visible = false;
            this.Panel4.Visible =true;
        }
     当单击下一步时  第二个panel出来  
  请各位师傅指点指点   谢谢!!!!!

解决方案 »

  1.   

    this.IsValid
    =>
    Page.IsValid
      

  2.   

    楼上的大哥  还是出不来啊  我做了4个panel  前三个能出来   就是最后一个步能出来   请你在思考一下   我实在不能找出是什么地方错了
      

  3.   

      this.Panel3.Visible = false;
    点击按钮肯定要隐藏。在阐述一下你的问题4个panel想要什么效果。比如点击 呈现几个隐藏几个。。
      

  4.   

    论坛签名======================================================================ganxiangdehaoma:你好!
    截至 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
      

  5.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="QuestionForCsdn.WebForm1" %><!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">
        <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;
                }
            }
        }
    }
      

  6.   

    using System;
    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";
    这个是我的代码  请你看哈  谢谢