且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我只需更新控制器,是不是?

更新时间:2023-02-12 11:10:58

1.您必须构建MVC项目并将生成的.DLL文件复制到应用程序部署位置的bin目录中(在您的服务器上)。 (如果只更改视图,在这种情况下,您应该将视图文件复制到View子文件夹中服务器上相关文件夹位置。)



2。关于与Paypal相关的问题根,您应该将所有PayPal设置(包括返回URL作为应用程序设置)放入 web.config 文件中,如下一个示例所示。 />
 <   appsettings  >  
< add key = 网页:版本 value = 1.0.0.0 / >
< add key = ClientValidationEnabled value = true / >
< add key = UnobtrusiveJavaScriptEnabled value = true / >

< add key = PayPalUsingSandbox value = true / >
< add key = PayPalSellerID value = XXXXXXXXXXXXX / >
< add key = PayPalCancelUrl value = http:// localhost:62710 / Order / CancelFromPayPal / >
< add key = PayPalReturnUrl value = http:// localhost:62710 /订单/ ReturnFromPayPal / >
< add key = PayPalNotifyUrl value = http:// localhost:62710 / Order / NotifyFromPayPal / >
< / appsettings >



3.Better是使用多个配置文件,例如你可以有一个配置文件用于调试(你的测试服务器)和第二个用于发布(真实服务器),并且每个配置文件都有不同的Paypal设置。在下一个链接中查看有关多个配置文件的详细信息:

ASP.NET MVC:保持私有设置不受源代码管理 [ ^ ]

http://deanhume.com/home/blogpost/working-with-multiple-web-config-files/4100 [ ^


This is very silly question for some expert.The situation is like this, I have asp mvc4 application I didn't publish it put it to the server, instead of I put my whole developing application solution on the server, Now I changed my method in my controllers in my local computer.

I need update my local change to the application sit at the server, I just need update the controllers, is it right?

Why I do like this, because the PayPal notify return url need return to the life url, so the project not really finish yet.

1.You have to build your MVC project and copy the resulted .DLL file into the bin directory of your application deployed location (on your server). (If you change only the view, in that case you should copy the view file in the associated folder location on your server in View sub-folder.)

2.Regarding your problem root related with Paypal, you should put all your PayPal settings, including the return URL as application settings into the web.config file like in the next example.
<appsettings>
    <add key="webpages:Version" value="1.0.0.0" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  
    <add key="PayPalUsingSandbox" value="true" />
    <add key="PayPalSellerID" value="XXXXXXXXXXXXX" />
    <add key="PayPalCancelUrl" value="http://localhost:62710/Order/CancelFromPayPal" />
    <add key="PayPalReturnUrl" value="http://localhost:62710/Order/ReturnFromPayPal" />
    <add key="PayPalNotifyUrl" value="http://localhost:62710/Order/NotifyFromPayPal" />
  </appsettings>


3.Better is to use multiple config files, so for example your could have one config file for debug (your testing server) and a 2nd one for release (the real server), and each of them to have different Paypal settings. See details about multiple config file in the next links:
ASP.NET MVC: Keep Private Settings Out of Source Control[^]
http://deanhume.com/home/blogpost/working-with-multiple-web-config-files/4100[^]