TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nicholas Mabe
NA
72
4.7k
How to filter an ajax url call with a variable in the URL?
Jan 15 2021 1:43 PM
I'm a bit stuck, any help is gratefully received.
I’m opening a view with the following address: https://localhost:44322/Admin/Account/Details/3
At this point it has filtered out the account I’m looking for which has the Id 0f 3. It returns the relevant data. Also on the view is a Datatable which also needs to be filtered with the same ID.
the datatable calls the data as follows:
" function loadDataTable() {
dataTable = $('#tblData').DataTable({
"ajax": { "url": "/Admin/Account/DetailsByAccount" },
If I change it to:
function loadDataTable() {
dataTable = $('#tblData').DataTable({
"ajax": { "url": "/Admin/Account/DetailsByAccount?Id=3" },
I get all the related records for the Account with the ID of 3, just what I’m looking for.
I’ve tried everything I can find to get the dynamic variable from the URL into the ajax url string but the only thing I’ve got is a headache.
Any help is gratefully received.
Reply
Answers (
2
)
How to create ajax function using dragula drag and drop in asp.net
How to check apostrophe in a inserted string