0

Pass 2 parameter in url using routing in Angularjs.

i.e. i want the url is like /Business/Industry/3/Aviation

Here is the MVC Controller:

public ActionResult Industry(int ServicesId, string Servicesname = "")
        {
            return View();
        }

Here is the anchor tag:

 <a href="#/Industry/{{list.Id}}/{{list.IndustryName}}">

Note:Both are dynamically list.Id and list.IndustryName

Here is the angular routing:

I have try the below but not correct.

can anyone tell me how to do. How to call by routing.

.when('/Business/Industry/:Id', { templateUrl: '/Business/Industry', controller: 'BusinessIndustry' });
2

1 Answer 1

0

You are nearly there:

.when('/view2/:pqid/:cid'

maps to a URL in this format :

view2/1234/4567

1234 being the pqid and 4567 the cid.

So your routing, I think is working, just change the link to #/view2/775/4.

Or if you want to keep the same link change your routing to:

#/view2/pqid/:pqid/cid/:cid
Sign up to request clarification or add additional context in comments.

1 Comment

in Industry mvc controller there are two parameter one is int and another one is string..okay..and what is the href in the anchor tag?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.