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

  • Home
  • SEARCH
  • 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 8235711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:54:09+00:00 2026-06-07T18:54:09+00:00

I am developing an ASP.Net MVC 3 Web Application. I have a Razor View

  • 0

I am developing an ASP.Net MVC 3 Web Application. I have a Razor View which enables the User to Create a new entry in the database. Within this Create View, there is a Drop Down List and when the User selects an option the following JQuery code fires

$(document).ready(function () {

$("#gradeID").change(ChangeEventOfDDL);

function ChangeEventOfDDL() {
    var dropDownValue = $('#gradeID').val();
    //alert(dropDownValue);
    $.ajax({ type: "POST",
        url: '/FormEmployment/CreateSpecialtiesPartialView/' + dropDownValue,
        success: function (data) {
            $('#SpecialtiesContent').html(data);
        }
    });
}

});

As you can see within this code I retrieve the selected Drop Down List value using

var dropDownValue = $('#gradeID').val();

When a User is Editing an entry, I wish to fire off a similar piece of code, only this time I would like to retrieve the entry ID in the QueryString which will look something like this

http://localhost:56354/FormEmployment/Edit/41

Does anyone know how I can get the value 41 using JQuery or is this even possible?

Thanks for your help.

Tony.

  • 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-07T18:54:11+00:00Added an answer on June 7, 2026 at 6:54 pm

    If you can make an assumption that the value you want to get is always after the last slash in the url, you can try:

    location.pathname.substring(location.pathname.lastIndexOf("/") + 1)
    

    By using location.pathname, you don’t have to worry about query string parameters, so the url could be http://localhost:56354/FormEmployment/Edit/41?foo=bar and it will still work as intended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application which is web-based (asp.net MVC). The user configures reminders
I am developing an ASP.Net MVC 3 Web application using Razor Views. I have
Good Morning All, I am developing a new ASP.net MVC web application. Part of
We are currently developing a web application in ASP.NET MVC which would really benefit
I am developing an ASP.Net MVC 3 Web Application using Razor Views. Within the
I have an Asp.Net MVC Web Application that I am developing. I have TeamCity
For the web application (ASP.NET MVC) I'm currently developing, we have the following architecture
I'm developing a web application using ASP.NET MVC (I'm new to the framework and
I am new to MVC. I am developing an web application in asp.net MVC.
I have started developing a full-web application by using the ASP .NET MVC 3

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.