1

I have an ActionResult return type inside my Controller which executes the default Index action.

public **ActionResult** Index(int _page, string **tabIdx**)

{

if (tabIdx == null)
                        ViewData.Add("TabIdx","0");
                    else
                        ViewData.Add("TabIdx", tabIdx);

                    **actionResult = View("Index");**

 return actionResult;

}

The ViewData variable is for processing inside my javascript, so you can ignore it for the purpose of this question.

What I need to do is to simply pass a querystring value for the tabIdx field in the above boldfaced line of code.

Something like View("Index") with a querystirng value appened to it.

How can I accomplish this?

1 Answer 1

2

You will have to use RedirectToAction. The URL already is set in stone after the request.

However, there might be a way to pass that value somewhere else so that it can be used without a redirect.

Sign up to request clarification or add additional context in comments.

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.