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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:41:11+00:00 2026-06-08T05:41:11+00:00

I am using asp.net and jQuery 1.6 In my function I am required to

  • 0

I am using asp.net and jQuery 1.6

In my function I am required to pass html tags as a data parameter to my server side method written in C#. In my Database the column has Blob datatype.
I am able to submit data successfully upto 528b but If I submit large data… I’m not able to send at server side.

When I pass small data it works and a row inserted. But If I pass data around 17Kb then this doesn’t go to the sever side, but prompt me an undefined error in jquery.

Following is Ajax Code:

$.ajax({
    type: "POST",
    url: "Post.aspx/savePost",
    data: "{Title:'" + Title + "',Html:'" + Html + "'}",
    contentType: "application/json",
    dataType: "json",
    success: function (data) {
        if (data == undefined) {
            alert("Error : 219");
        }
        else {
            alert(data.d);
        }
    },
    error: function (data) {
        if (data == undefined) {
            alert("Error : 465");
        }
        else {
            alert("Error : 468 " + data.d);
        }
    }
});

Following is C# code

[System.Web.Services.WebMethod]
public static string savePost(string Title,string Html)
{
    string retMsg = "Not Saved";
    Post bp = new Post();
    int count = 0;
    count = bp.mySavePost(Title,Html);
    if (count > 0)
    {
        retMsg = "Post Save Successfully.";
    }
    return retMsg;
}

protected int mySavePost(string Title, string Html)
{
    int count=0;
    try
    {
        string rawQuery = "INSERT INTO temp_posts (Title,HTML)"
                        + " VALUES(?Title,?HTML)";
        cmd = new MySqlCommand();
        cmd.CommandText = rawQuery;
        cmd.CommandType = System.Data.CommandType.Text;
        cmd.Parameters.Add("?Title", MySqlDbType.VarChar).Value = Title;
        cmd.Parameters.Add("?Html", MySqlDbType.Blob).Value = Html;
        count = c.insertData(cmd);
     }
     catch(Exception ex){}
 }

Please guide me with you valuable knowledge.
Thanks.

  • 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-08T05:41:12+00:00Added an answer on June 8, 2026 at 5:41 am

    Many Thanks to everyone who put his best effort for this thread.

    Finally with the help of one my senior I found where I was lacking in my code.

    As I am passing html tags as a data parameter to my server side method written in C# from jQuery.ajax(); I need to encode the data.

    As I used the escape() function in javascript to encode it worked. Data is submitted to database.

    var encodedHTML = escape(Html);         //here encoding Html.
    $.ajax({  
        type: "POST",   
        url: "Post.aspx/savePost",  
        data: "{Title:'" + Title + "',Html:'" + encodedHTML + "'}",  
        contentType: "application/json",  
        dataType: "json",  
        success: function (data) {  
            if (data == undefined) {  
                alert("Error : 219");  
            }  
            else {  
                alert(data.d);  
            }  
        },  
        error: function (data) {  
            if (data == undefined) {  
                alert("Error : 465");  
            }  
            else {  
                alert("Error : 468 " + data.d);  
            }  
        }  
    });  
    

    Thanks everyone 🙂

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

Sidebar

Related Questions

I am performing both clientside validation and server side validation using jquery and Asp.net
Problem: jQuery DataTables server-side processing using ASP.NET WebForms. Solution: Darin Dimitrov answered the question
In my ASP.Net page, I am loading data from server while scrolling using jQuery
With ASP.NET MVC3 I'm using Jquery/Ajax to post data from a form to a
I am using ASP.Net and jQuery/jQuery UI and I am trying to use the
Hi This is kind of peculiar requirement.. I am using asp.net and jQuery together
Using ASP.NET MVC + jQuery : I need to use some values owned by
I am using jquery with asp.net webforms..... I am using asp.net pagemethods and jquery....
I am using asp.net mvc and jquery to make ajax requests and when the
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine

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.