表单数据未显示在第二页上

问题描述 投票:0回答:1

这是页面的代码,其中表单数据应该显示在文本框中,但它甚至不定向到此页面并停留在同一页面上..页面只是在单击提交时闪烁,没有其他反应..

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"];
        }
    }
}

下面是我在其他页面上的提交按钮的代码,该页面上有一个带有提交取消按钮的表单。为什么它不起作用?怎么了?

.
.
.


 <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>

我尝试将 PostBackUrl="~/frmPersonalVerified.aspx" 更改为 PostBackUrl="frmPersonalVerified.aspx" 但没有成功。怎么了?

我还在frmPersonalVerified页面的页面加载方法中添加了一个断点..它没有进入其中。

c# asp.net .net forms form-submit
1个回答
0
投票

我认为你应该选择提交按钮的 onclick 事件

 protected void btnSubmit_Click(object sender, EventArgs e)
 {

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

 }
© www.soinside.com 2019 - 2024. All rights reserved.