简体   繁体   中英

Parser error on redirect?

I get a parser error when running my code and have checked references but everything seems in place.The error occurs when on a redirect from a page The error occurs on line 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" %>

This is my redirect function on another page

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

OR

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

OR

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

Either one of them should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM