Skip to content

Commit f632d21

Browse files
Update Controller.cs
1 parent fc9c51e commit f632d21

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

class/Controller.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,26 @@ public void IgnoreAll()
9191
IgnoreLayout = true;
9292
}
9393

94+
public void SetViewPath(HttpContext context, string Path)
95+
{
96+
if (Path.Contains("?"))
97+
{
98+
ViewPath = ">" + Path.GetTextBeforeValue("?");
99+
100+
string QueryString = Path.GetTextAfterValue("?");
101+
new RequestQuery().AddQueryString(context, QueryString);
102+
}
103+
else
104+
ViewPath = ">" + Path;
105+
}
106+
107+
public void SetErrorPage(HttpContext context, int ErrorValue)
108+
{
109+
SetViewPath(context, StaticObject.ErrorPagePathBeforeValue + ErrorValue + StaticObject.ErrorPagePathAfterValue);
110+
111+
context.Response.StatusCode = ErrorValue;
112+
}
113+
94114
public void Download(string FilePath)
95115
{
96116
DownloadFilePath = FilePath;

0 commit comments

Comments
 (0)