0
<td><button id="@questions.QbId" onclick="@Url.Action("ViewQuestionDetails","Admin" , new { QBID=questions.QbId })" class="btn btn-primary">View</button></td>

on button click i need to call a method in controller by using Qbid but it is not working

1
  • A button is not a hyperlink. If you want to do this without JavaScript then use a hyperlink. Commented Nov 12, 2019 at 14:51

1 Answer 1

2
<td><button id="@questions.QbId" class="btn btn-primary" onclick="location.href='@Url.Action("ViewQuestionDetails", "Admin", new {QBID=questions.QbId})'">View</button></td>
Sign up to request clarification or add additional context in comments.

1 Comment

Provide some explanation of what this will do.

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.