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 6835343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:13:16+00:00 2026-05-26T23:13:16+00:00

0 Project In my view I have a hidden filed which has a UserID

  • 0

0 Project

In my view I have a hidden filed which has a UserID. This user id is generated upon an action (so this will not be know prior)

Once this hidden field has a value, I would like to use that value as an actionlink routevalue. Can I do it with a jquery selector.

My hidden field is

<input id="NewUserID" type="hidden" value="80">

My ajax.ActionLink is

@Ajax.ActionLink("Edit", "EditUser", "User", new { UserID = "$('#GetNewPatientID').val()" },
        new AjaxOptions
        {
            OnSuccess = "ShowEditUserForm",
            UpdateTargetId = "EditUserDetails",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "Get"
        }, new { @class = "button", id = "EditUserButton" }) 

Any idea if this is possible?

  • 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-05-26T23:13:17+00:00Added an answer on May 26, 2026 at 11:13 pm

    When generating the action link on the server you could put some special placeholder for the UserID route value:

    @Ajax.ActionLink(
        "Edit", 
        "EditUser", 
        "User",    
        new { 
            UserID = "__userid__" 
        },
        new AjaxOptions {
            OnSuccess = "ShowEditUserForm",
            UpdateTargetId = "EditUserDetails",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "Get"
        }, 
        new { 
            @class = "button", 
            id = "EditUserButton" 
        }
    ) 
    

    and then when you assign a value to the hidden field in javascript you could update the action link href as well:

    $('#EditUserButton').attr('href', function() {
        return this.href.replace('__userid__', $('#NewUserID').val());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have BaseView which implement UIViewController. Every view in project must implement this BaseView.
In my MVC project I have a chart being generated on my view as
I have a simple HTML form which consists of radio buttons where user has
I have taken on an MVC project that has a view that displays several
I have a user facing form, which is generated from a model. The model
I have developed a view based project in Xcode. It is successfully running in
I have two view Controllers in my project ViewController , SettingsView . Here I
I have a view in a Django 1.4 project: def index(request): print reverse('menus_index') latest_menu_list
I have a UIScrollView in my project. I have a view controller I would
I am using MVC3 on my project. I have a view with tables and

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.