简体   繁体   English

将vs 2010网站发布到本地iis

[英]publish vs 2010 website to local iis

I struggling on hours to accomplish this. 我花了几个小时才能做到这一点。
I have created a web site in VS 2010. Now I need to host this on my local IIS(My development PC) for the testing. 我已经在VS 2010中创建了一个网站现在,我需要将其托管在本地IIS(开发PC)上进行测试。

I created a web site on inetmgr and publish the web site using VS. 我在inetmgr上创建了一个网站,并使用VS发布了该网站。 Now I can access it. 现在,我可以访问它。 It is Fine. 没事。

But it is not functioning properly now. 但是它现在不能正常运行。
I have a web form and once I submit it do some steps which I coded in my code behind and redirect to another page (This is what needs to be happen). 我有一个Web表单,一旦提交它,请执行一些步骤,这些步骤将在我的代码后面进行编码,然后重定向到另一个页面(这是需要做的事情)。

But now it is not happening.Once I click on the button it will reload the page. 但是现在没有发生,一旦我单击按钮它将重新加载页面。

In side the publish folder I can only see the .aspx files. 在publish文件夹旁边,我只能看到.aspx文件。 Cannot find .cs files. 找不到.cs文件。

What is the wrong I did here. 我在这里做错了什么。
Have I missed something? 我错过了什么吗? If you can plesae provide me some urls to compete step by step guidance. 如果可以请plesae为我提供一些网址,以逐步指导您进行竞争。

Edit 编辑
Default.aspx. Default.aspx。

        string filePathVal = ((TextBox)CustomerDataPanel.FindControl("FilePath")).Text;

        if (!File.Exists(filePathVal))
        {
            errorMsgPannel.Visible = true;
            return;
        }

        Response.Redirect("result.aspx?status=success", false);

Finally I Fixed my issue. 最后,我解决了我的问题。 But still have doubt why previous approach did not work. 但是仍然怀疑为什么以前的方法行不通。 I used Creating a Web Project as an IIS Virtual Root this to fix my issue. 我使用创建Web项目作为IIS虚拟根目录来解决此问题。 :) :)

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

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