Link to home
Start Free TrialLog in
Avatar of Sat Nuna
Sat Nuna

asked on

Error happened only after when asp.net deployed

I developed asp.net with mvc.
I had error after when I deployed in IIS.
(Windows 10)
Error show me controller is not found when ajax called it.
In using visual studio , it is working fine.
What is problem?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

have you deployed everything in the bin folder into target folder for your iis website/application?
Avatar of Sat Nuna
Sat Nuna

ASKER

Yes, I deployed everything in the bin folder.
I used visual studio for deployment.
And I can access other controller actions other than the action called from ajax.
how's your ajax and controller codes look like?
ajax call is below

        function sendAjax(ID) {
            var serviceURL = '/ShoppingAjax/FirstAjax';
            var productId = ID;
            $.ajax({
                url: serviceURL,
                type: "POST",
                data: { Id: productId },
                dataType: 'json',
                success: successFunc,
                error: errorFunc
            });
        }

controller is bellow

        [HttpPost]
        public ActionResult FirstAjax(string Id)
        {
              …

Does it have problem?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
are you re-built your solution before the deployment?
Yes, but It doesn't work.

are you able to do a separate posting to /ShoppingAjax/FirstAjax?
It's difficult for me , I'm trying to understand how to use Postman.
Yes, but It doesn't work.
if you can't re-build the solution it probably means there are still some issues in your solution. try to solve it, then re-build and deploy accordingly.
I think it will need time to understand.
I would like to close this session at this time.