请检查出PostBackUrl中的错误? [英] Please check out error in PostBackUrl ?

查看:75
本文介绍了请检查出PostBackUrl中的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该页面不是回发页面.请检查错误...

Transferring_Information1.aspx

The page is not PostBack.Please check out the error...

Transferring_Information1.aspx

<div>

<asp:Button runat="server" ID="cmdPost" PostBackUrl="~/Topics/Transferring Information/Transferring_Information2.aspx"

            Text="Cross-Page Postback" /><br />
</div>




Transferring_Information2.aspx




Transferring_Information2.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Transferring_Information2.aspx.cs" Inherits="Topics_Transferring_Information_Transferring_Information2" %>
<%@ PreviousPageType VirtualPath="~/Topics/Transferring Information/Transferring_Information1.aspx" %>
<!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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblInfo" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>



Transferring_Information2.aspx.cs



Transferring_Information2.aspx.cs

protected void Page_Load(object sender, EventArgs e)
    {
        if (PreviousPage != null)
        {
            lblInfo.Text = "You came from a page titled " +PreviousPage.Title + "<br />";
        }
    }

推荐答案


Transferring_Information1.aspx页中是否有任何验证
然后将CauseValidation

If there is any validation in Transferring_Information1.aspx page
then put CauseValidation
<asp:Button runat="server" ID="cmdPost" CauseValidation="false" PostBackUrl="~/Topics/Transferring Information/Transferring_Information2.aspx"

            Text="Cross-Page Postback" />


另一个原因可能是重定向URL,删除多余的空间并相应地重命名目录,然后重试,即,将传输信息重命名为TransferringInformation并在下面使用此代码,


Another reason might be Redirection URL, remove the extra space and rename the directory accordingly and try again, i.e. rename Transferring Information to TransferringInformation and use this code below,

<asp:Button runat="server" ID="cmdPost" CauseValidation="false"
PostBackUrl="~/Topics/TransferringInformation/Transferring_Information2.aspx"
Text="Cross-Page Postback" />


希望这会有所帮助.


Hope this will help.


<asp:button id="Button2"

      text="Post value to another page"

      postbackurl="Button.PostBackUrlPage2vb.aspx"

      runat="Server">
    </asp:button>


这篇关于请检查出PostBackUrl中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆