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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:21:21+00:00 2026-06-17T03:21:21+00:00

I have a calender control and on selecting a respective date, I need to

  • 0

I have a calender control and on selecting a respective date, I need to display Today’s Due and Over due as two section in an accordion. I have written the div for accordion in code behind and set style.css to give the look of Accordion. The data from code behind is converted into json and displayed. The code behind is as follows:

[WebMethod(EnableSession = true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string CalenderBinderAccordian()
        {
            try
            {
                //Code to fetch productGroup is not shown
                foreach (var p in productGroup)
                {
                    var todoCount = 1;
                    string todoString = "";
                    int uniqueID = Guid.NewGuid().GetHashCode();
                    todoString = "<div class='accordion vertical'><section id='" + uniqueID + "' style='overflow-y: scroll;'> <h2><a href=#" + uniqueID + "><b>Due Today</b></a></h2>";    
                    foreach (var t in p.todo)
                    {
                        var tempAmt = String.Empty;
                        if ((t.Amount == null) || t.Amount == String.Empty)
                            tempAmt = "0";
                        else
                            tempAmt = Convert.ToDecimal(t.Amount.ToString()).ToString();                          
                        todoString += "<p><div style='padding:5px 0px; border-bottom:dashed 1px #dddddd;'><b>" + todoCount.ToString() + "</b>. " + t.ProductName + "<span style='text-align:right; padding-right:5px;'> $" + tempAmt + "</span><a href='www.google.com' target='_blank' style='text-decoration:none;'><b>Pay Now</b></a></div></p>";
                        todoCount++;
                    }
                    todoString += "</section>";   

                    var overDue = temps.Select(x => new { x.DueDate }).Distinct().ToList();
                    int overDueCount = 0;
                    uniqueID = Guid.NewGuid().GetHashCode();
                    todoString += "<section id='" + uniqueID + "'> <h2><a href=#" + uniqueID + "><b>Over Due</b></a></h2>";
                    int todoCount1 = 1;
                    for (int i = 0; i < overDue.Count(); i++)
                    {

                        if ((Convert.ToDateTime(overDue[i].DueDate) - Convert.ToDateTime(p.dates)).Days < 0)
                        {
                            overDueCount++;

                            var overDueList = temps.FindAll(x => x.DueDate.Equals(overDue[i].DueDate)).ToList();
                            foreach (var t in overDueList)
                            {
                                var tempAmt = String.Empty;
                                if ((t.Amount == null) || t.Amount == String.Empty)
                                    tempAmt = "0";
                                else
                                    tempAmt = Convert.ToDecimal(t.Amount.ToString()).ToString();
      //Error occurs when the href is given as aspx                                                           
                                todoString += "<p><div style='padding:5px 0px; border-bottom:dashed 1px #dddddd;'><b>" + todoCount1.ToString() + "</b>. " + t.ProductName + "<span style='text-align:right; padding-right:5px;'> $" + tempAmt + "</span><a href='PaymentDetails.aspx' target='_blank' style='text-decoration:none;'><b>Pay Now</b></a></div></p>";
                                todoCount++;
                                todoCount1++;
                            }

                        }
                    }

                    todoString = todoString + "</section></div>\",\"count\":\"" + todoCount + "\"},";
                    jsonString = jsonString + String.Format("{{\"{0}\" : \"{1}\",\"{2}\" : \"{3}", "dates", p.dates, "todo", todoString);

                    if (overDueCount.Equals(0))
                    {
                        jsonString = jsonString.Replace("</section><section id='" + uniqueID + "'> <h2><a href=#" + uniqueID + "><b>Over Due</b></a></h2></section>", "</section>");
                    }  

                }
                jsonString = jsonString.TrimEnd(',');
                jsonString = '[' + jsonString + ']';
               string data= jsonString; JavaScriptSerializer().Serialize(productGroup);
                return data;
            }
            catch (Exception ex)
            {
                throw;
            }
        }

//How to data is converted to Jsonvar tododate = [];

$(window).bind('loaded', function () {
    $.ajax({
        type: "POST",
        url: "ChartBinder.asmx/CalenderBinderAccordian",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {        
            tododate = JSON.parse(msg.d);

        },
        error: function (msg) {
            alert("error");
        }
    });   
});

Kindly note when the href is given as http://www.google.com the functionality works well but when it is given as PaymentGateway.aspx It does not display date in accordion format rather shows error alert.

  • 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-17T03:21:22+00:00Added an answer on June 17, 2026 at 3:21 am

    Using Firebug, Noticed the following Error:
    Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property
    Solution: Tried changing the configuration :

    <configuration> 
    <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="50000000"/>
      </webServices>
    </scripting>
    

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

Sidebar

Related Questions

I have a calender control and on selecting a respective date, I need to
I have a textbox for date. It has calender control extender to select date.
i have a database with three rows id,des,date and i have a calender control
I have a problem using the calender control .. I am getting the date
I need to have the Calendar Control start 36 hours after the current date.
i have date like string date = calarc.SelectedDate.ToString(MM/dd/yyyy); where calarc is calender control. It
I have a Drupal 7 site and need to output a small calendar control
I have this Calendar Control I am using. A user can select any date
I have embedded the calender (datefield and datechooser) control of flex in cfm. When
I am working on an asp page. I need to have a calendar control

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.