从同一解决方案中的另一个项目调用webform [英] Call webform from another project within the same solution

查看:100
本文介绍了从同一解决方案中的另一个项目调用webform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解决方案中有两个项目。

第一个项目叫做MainWeb,有一个表格Main.aspx

第二个项目名为Security,有一个表格RevisionHistory.aspx

如何从表格Main.aspx访问表格RevisionHistory.aspx



提前致谢



我尝试了什么:



我尝试过使用代码



Response.Redirect(/ Security / RevisionHistory.aspx)



和网页显示错误服务器错误在'/'应用程序。

I Have two projects with in a Solution.
The first project is called MainWeb and has a form Main.aspx
The Second project is called Security and has a form RevisionHistory.aspx
How do I access the form RevisionHistory.aspx from the form Main.aspx

Thanks in advance

What I have tried:

I have tried using the code

Response.Redirect("/Security/RevisionHistory.aspx")

and the web page shows the error Server Error in '/' Application.

推荐答案

如果您只想在一个解决方案中同时运行2个Web应用程序。

First你需要设置解决方案的属性,设置多个启动项目:

并将两个Web应用程序的Action设置为Start。



当你这样做



你的Response.Redirect代码与绝对网址将工作。



If you are just want 2 web applications run at the same time in a single solution.
First thing you need to set the solution's properties, set Multiple startup Projects:
and set Action for both web application to "Start".

when you did that

Your Response.Redirect code with Absolute Url will work.

Response.Redirect("http://localhost:49285/Contact.aspx", true);





但是在发布它时,你必须处理这个URL,所以从配置AppSetting中取出http:// localhost:49285 / this,根据你的QA设置它或者暂存或生产环境。



But while publishing it, you have to take care of this url, so take the "http://localhost:49285/ this from configuration AppSetting to set it as per your QA or staging or Production environment.


这篇关于从同一解决方案中的另一个项目调用webform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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