0

运行我的代码并检查了引用时出现解析器错误,但一切似乎都到位。从页面重定向时发生错误错误发生在第 1 行。

<%@ Page Title="CreateUser" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="CreateUser.aspx.cs" 
    Inherits="ICSWebPortal.Portal.Pages.User.CreateUser" PageName="Create User" PageDescription="Details of user" %>
<%@ MasterType VirtualPath="~/Main.Master" %>

这是我在另一个页面上的重定向功能

function CreateNewUser()
{
    window.location = "<% = GetHost() %>/User/Create/"
}
4

1 回答 1

0
window.location = "<%= GetHost() %>/User/Create/";

或者

window.location = "<%# GetHost() %>/User/Create/";

或者

window.location = "<%: GetHost() %>/User/Create/";

其中任何一个都应该工作。

于 2013-09-13T17:04:51.933 回答