Home > DeveloperSection > Forums > Form data is not getting displayed on 2nd page
Jeet Verma
Jeet Verma

Total Post:110

Points:776
Posted on    August-21-2014 1:00 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 585  View(s)
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..



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-21-2014 1:15 AM

Hi Jeet, 
try this :

protected void btnSubmit_Click(object sender, EventArgs e)

 {

     Response.Redirect("~/frmPersonalVerified.aspx");

 }


Don't want to miss updates? Please click the below button!

Follow MindStick