Home > Net >  ASP.NET MVC is deployed to the IIS application problems
ASP.NET MVC is deployed to the IIS application problems

Time:12-09

Asp.net MVC 4.6 in local development and test is normal, the deployment to the IIS server, login page display is normal, login to submit tip can't find the resources, the analysis of some of the following file path

 web. Config 


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The route. The config

Routes. The MapRoute (
Name: "Default",
Url: "{controller}/{action}/{id}",
Defaults: new {controller="login", action="login", id=UrlParameter. Optional}
);

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The form submission

Form. On (' submit (login - BTN), function (data) {
$. Ajax ({
Type: "POST",
Url:/login/login ", "
Data: {
"LoginName:" data. Field. LoginName,
"Password" : data. Field. Password
},
Success: the function (result) {
If (result. Code==0) {
Layer. MSG (result. MSG);
} else {
Layer. MSG (result. MSG);
}
}
});
});






Above are relative paths, program development is to establish "phoneTest" solution, and deployed to the iis, establish application is also "phoneTest", but the debug log in to submit, the path becomes http://192.168.1.6/login/login, not http://192.168.1.6/phoneTest/login/login, so am always tip can't find the 404, how does this configuration, each place all need hard to add "phoneTest path?"

CodePudding user response:

Urgent urgent!!!!!!

CodePudding user response:

Url:/login/login ", "
Change
Url: "the login/login,"

Give it a try

CodePudding user response:

Tried, still won't do

CodePudding user response:

Ajax to submit the relative path has a problem, url: "the login/login", url: "~/login/login", url: "./login/login ", all not line

CodePudding user response:

Call address found out, and then go to your application (deployed folder), view, whether to have the file,
The problem of WEB, more than 70%, is the problem of path, I play out,

CodePudding user response:

Can we didn't load js file, you see your js file is here or not, I also sent a such a request for help before, many people all sorts of all sorts of guidance, is finally found himself the IIS configuration is not complete, and your problems
  • Related