Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:34:25+00:00 2026-06-03T10:34:25+00:00

In my view i have 10 link every link associated with some unique value.

  • 0

In my view i have 10 link every link associated with some unique value. Now i want that associated value at my controller action and from that action i want to redirect the flow to some other action based on that value.

But the condition is i dont want to display it on url.

How can i acheive this?

  • I tried ajax.post/@Ajax.ActionLink but doing this will not facilitate redirect to another action.
  • Is there anything with route i need to do?

View

    <ul>@foreach (var item in Model)
    {<li>
  @Ajax.ActionLink(item.pk_name, "Index","Candidate", new { para1= item.para1 }
             , new AjaxOptions { HttpMethod = "POST" })</li>
    }</ul>

Action

[HttPost]
public ActionResult(int para1)
{
return RedirectToAction(para1,"anotherController");
}

I am getting value at para1 with ajax post(that is what i primarily needed) but here also want to redirect my application flow base on para1 value which is action name.

Confision : here i am not sure is this is the right way to do this thing. So i am asking you guys should i go for route map of working with ajax post will solve my objective.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:34:26+00:00Added an answer on June 3, 2026 at 10:34 am

    If you only need to redirect the user based on what he clicks on without showing him the link, I believe the best way to achieve this is by client-side coding.

    In my opinion there is no need to take any request through the server in order to change the page for such a low-complexity redirect.

    View

    // HTML
    // Might be broken, been awhile since I worked with MVC
    // Can't really remember if that's how you put variables in HTML
    <ul id="button-list">
        @foreach(var item in Model)
        {
            <li class="buttonish" data-para1="@item.para1">@item.pk_name</li>
        }
    </ul>
    
    // JS
    // I wouldn't do any server related work
    $('#button-list li.buttonish').click(function(){
        // Your controller and action just seem to redirect to another controller and send in the parameter
        window.location.href = "/controller/method/" + $(this).data('para1');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UserMailer View that has several link_to's like so: <%= link_to('XXXXXXXX Link
Using Rails v2.1, lets say you have an action for a controller that is
I have a primary link accommodation, then i have created a view , called
In my View, I have included the css : <link rel=stylesheet type=text/css href='<%=Url.Content(~/Content/login.css)%>'/> in
I have view controller, into the view i have put a table view, and
i have view controller which contains a button which show the image library ,if
I have a view in which there is a list.Every record in the list
I have a classifieds website. In every classified, there is a back link which
I have a form for create/edit articles. Every article is associated with an user.
MVC3 VB.NET Razor view Application... I have a view that uses a for each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.