1

I want to pass two parameters from one page to other page. I am able to pass single parameter. when it comes to two parameters, i get the error http 404 could not found. My View

My Code What I want to achieve here is, I want to share trainer id and title to the next page. When i put , it gives me error like HTTP 404 .

Kindly help me with this.

Thanks

3
  • Could you add the controller code for DetailedTrainerView? It would make it easier to see what the issue is. Commented Mar 21, 2016 at 9:35
  • Just added. Would like to pass two parameters to next page. How can i use query string in view? Commented Mar 21, 2016 at 9:54
  • Is DetailedTrainerView action method? Commented Mar 21, 2016 at 10:07

2 Answers 2

2

Maybe replace your hyperlink with

 <a href="@Url.Action("DetailedTrainerView","CategoryTrainer",new
                                        {
                                            [email protected],
                                            [email protected]
                                        })>Link text</a>
Sign up to request clarification or add additional context in comments.

2 Comments

Nice example, I practice doing the same.
Thank you so much. Working perfectly. :)
0

Use

href="<%: Url.Action("DetailedTrainerView", "CategoryTrainer", new { trainerID = @item.TrainerID, title = @item.Title }) %>"

and make sure your action method has same parameter name and sequence.

Comments

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.