FORM DATA IS NOT GETTING DISPLAYED ON 2ND PAGE

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
 983  View(s)
Ratings:
Rate this:

This is the code of the page where data of form is supposed to display in a text box but its not even directing to this page and stays on the same page..page just blinks on click of submit and nothing else happens..

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace PayrollSystem
{
    public partial class frmPersonalVerified : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Add your comments here
            txtVerifiedInfo.Text = Request["txtFirstName"] +
                "\n" + Request["txtLastName"] +
                "\n" + Request["txtPayRate"] +
                "\n" + Request["txtStartDate"] +
                "\n" + Request["txtEndDate"];
        }
    }
}

Below is the code of submit button that I have on my other page that has a form with submit cancel buttons..why is it not working? whats wrong? Please help...

 <asp:Button ID="btnSubmit" runat="server" Text="Submit"
            PostBackUrl="~/frmPersonalVerified.aspx" />
        &nbsp;&nbsp;
        <asp:Button ID="btnCancel" runat="server" Text="Cancel"
             PostBackUrl="~/frmMain.aspx"/>
        </asp:Panel>

I tried changing PostBackUrl="~/frmPersonalVerified.aspx" to PostBackUrl="frmPersonalVerified.aspx" but it didnt work. whats wrong?

I also added a break point in the page load method of frmPersonalVerified page..it doesnt go inside it..

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: Form data is not getting displayed on 2nd page

    Hi Jeet, 

    try this :
    protected void btnSubmit_Click(object sender, EventArgs e)
     {
         Response.Redirect("~/frmPersonalVerified.aspx");
     }

      Modified On Apr-04-2018 06:12:16 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!