如何设置值的标签?

如何设置标签的值

我在最后一页中传递了第一和第二个表单值,但是问题是我没有设置该值的标签

见下图

enter image description here

PersonalDetail.aspx

   <form id="form1" runat="server">  
        <h1 style="text-align: center">Personal Information:</h1>  

        FirstName:<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>  
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please Enter Your Name" ControlToValidate="txtFirstName" ForeColor="Red"></asp:RequiredFieldValidator>  
        <div style="margin-left: 5px"></div>  

        LastName:<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>  
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please Enter Your LastName" ControlToValidate="txtLastName" ForeColor="Red"></asp:RequiredFieldValidator>  
        <div style="margin-left: 5px"></div>  

        Date Of Birth:<asp:Calendar ID="txtcalender" runat="server"></asp:Calendar>  

        <div style="text-align:center">  
            <asp:Button ID="Button1" runat="server" Text="Next" OnClick="Button1_Click" />  
        </div>  
    </form>  

PersonalDetail.aspx.cs

 protected void Button1_Click(object sender, EventArgs e)  
 {  
    Response.Redirect("ContactInformation.aspx?FirstName=&LastName=&DateofBirth=" + txtFirstName.Text +txtLastName.Text + txtcalender.SelectedDate);  
 }

contactinformation.aspx

  <form id="form1" runat="server">  
       <h1 style="text-align: center">Contact Information:</h1>  

       EmailId:<asp:TextBox ID="txtEmailid" runat="server"></asp:TextBox>  
       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please Enter Your EmailId" ControlToValidate="txtEmailid" ForeColor="Red"></asp:RequiredFieldValidator>  
       <div style="margin-left: 5px"></div>  

       MobileNo:<asp:TextBox ID="txtMno" runat="server"></asp:TextBox>  
       <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please Enter Your MobileNo" ControlToValidate="txtMno" ForeColor="Red"></asp:RequiredFieldValidator>  
       <div style="margin-left: 5px"></div>  

       Password:<asp:TextBox ID="txtPass" runat="server" TextMode="Password" ></asp:TextBox>  
       <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please Enter Your Password" ControlToValidate="txtPass" ForeColor="Red"></asp:RequiredFieldValidator>  
       <div style="margin-left: 5px"></div>  

       <div style="text-align:center">  
       <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />  
       </div>  
   </form>  

contactinformation.aspx.cs

    public partial class ContactInformation : System.Web.UI.Page
    {
        string FirstName;
        string LastName;
        string DateofBirth;

        protected void Page_Load(object sender, EventArgs e)
        {
             FirstName = Request.QueryString["FirstName"].ToString();
             LastName = Request.QueryString["LastName"].ToString();
             DateofBirth = Request.QueryString["DateofBirth"].ToString();
        }

        protected void Button1_Click(object sender, EventArgs e)
        { 
               Response.Redirect("DisplayPage.aspx?FirstName=&LastName=&DateofBirth=&EmailId=&MobileNo=" + FirstName + LastName + DateofBirth + txtEmailid.Text + txtMno.Text);
        }

DisplayPage.aspx.cs

    public partial class DisplayPage : System.Web.UI.Page
    {     
        string EmailId;
        string MobileNo;

        protected void Page_Load(object sender, EventArgs e)
        {
            EmailId = Request.QueryString["EmailId"].ToString();
            MobileNo = Request.QueryString["MobileNo"].ToString();
        }
    }

例如:

应该看起来像

  • 名字:raju
  • 姓氏:maks
  • DOB:00/00/0000
  • EmailId:raju@gmail.com
  • 手机号码:0000000000
评论