简体   繁体   English

从.net aspx重定向到html

[英]Redirect from .net aspx to html

I am on a .net 4 aspx page and I simply want to redirect to an html page that is located in the same site location. 我在.net 4 aspx页面上,我只想重定向到位于相同站点位置的html页面。 When I try to do the following, I get the error {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} 当我尝试执行以下操作时,出现错误{由于代码已优化或本机框架位于调用堆栈的顶部,因此无法评估表达式。}

Response.Redirect("ContractorEnvironment.html");

I have to use an aspx page for logging in but my application is on a single html page. 我必须使用aspx页面进行登录,但是我的应用程序位于单个html页面上。

SLaks answered the question: 奴隶们回答了这个问题:

I have to use a custom login process and needed a try/catch to manage errors but if login is successful, I was redirecting within the try. 我必须使用自定义登录过程,并且需要尝试/捕获来管理错误,但是如果登录成功,我将在尝试中进行重定向。 Simply moved the redirect outside the try. 只需将重定向移到尝试之外即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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