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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:25:54+00:00 2026-05-14T22:25:54+00:00

So I am using a jquery plug in that allows me to change the

  • 0

So I am using a jquery plug in that allows me to change the order of things in a list by dragging and dropping them.
So my goal is to be able to grab a list of my objects (AlertInfo) and using it in a javascript function.
I was able to use a json webservice call in a test project to pass the data to the page.
But we don’t have a webservice page now so I tried to grab it from a aspx.cs page and it hasn’t worked.

///Aspx page:

$.ajax({
   type: "POST",
   url: "~/Alerts/GetAlerts",
   data: "{}",
   contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (msg) {
        var data = eval("(" + msg.d + ")");
        jQuery.each(data, function (rec) {
        AlertList[AlertList.length] = new objAlert(this.id, this.title, this.details,               JSONDateSerializationFix(this.startdate), JSONDateSerializationFix(this.enddate));
        UpdateDisplayList();
     })
     },
     error: function (msg) {
        alert("BRAD" + msg);
     }

The issue is that the Alerts page in “URL /Alerts/GetAlerts” is Alerts.aspx.cs. I can’t figure out if I can use this ajax command to call a method in a aspx.cs page.
//Code behind page aspx.cs

[WebMethod]
 //[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetAlerts()
{
  List<AlertInfo> list = AlertInfo.GetTestAlerts();
  return new JavaScriptSerializer().Serialize(list);
}

public List<AlertInfo> GetAlertsList()
{
  List<AlertInfo> list = AlertInfo.GetTestAlerts();
  return list; ;
}

So I was hoping that I could load data into an asp control (dataList) and then grab the data

//code behind page

protected void Page_Load(object sender, EventArgs e)
{
    dataListAlertList.DataSource = GetAlertsList();
    dataListAlertList.DataBind();
}
public static List<AlertInfo> GetTestAlerts()
{
            List<AlertInfo> list = new List<AlertInfo>();
            list.Add(new AlertInfo("0", "Alert 1 Title", "Alert 1 Detail", "10/10/2010", "10/10/2011"));
            list.Add(new AlertInfo("1", "Alert 2 Title", "Alert 2 Detail", "10/10/2010", "10/10/2011"));
            return list;

}

//.aspx page

$(document).ready(function () {
    var a1 = $("#dataListAlertList").val();
    // do fun stuff now.
}

But I keep getting undefined….

  • 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-14T22:25:55+00:00Added an answer on May 14, 2026 at 10:25 pm

    Didn’t need to preload. Ended up using the datalist and then changed how it was formatted. In the document ready function I grabbed the divs and applied the properties that needed to be set.

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

Sidebar

Related Questions

I am using the FlexiGrid jQuery plug in and I need to get a
Using jQuery, is there a way to select all tag that reference a specific
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,
Using jQuery, how do you check if there is an option selected in a
Using jquery how do I focus the first element (edit field, text area, dropdown
Using jQuery, what's the best way to find the next form element on the
Using jQuery, how do I delete all rows in a table except the first?
Using jQuery, how would you find elements which have a particular style (eg: float:
When using jQuery 's ajax method to submit form data, what is the best

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.