I am using Jqgrid. I want to display Delete msg according to server Response .
but as i am using response.responsText i am getting full HTML page Content.. help me
afterComplete: function(response,postdata,formid) {
alert("'"+response.responseText+"'")
}
DataTable dr = new DataTable();
da.SelectCommand = new SqlCommand("select * from CustomerOrders where QuotationID='" + ID + "'", conn);
conn.Open();
da.SelectCommand.ExecuteNonQuery();
da.Fill(dr);
conn.Close();
if (dr.Rows.Count > 0)
{
Response.Write("dddd");
}
else
{
da.DeleteCommand = new SqlCommand("delete from QuotationTemplates where QuotationID='" + ID + "'", conn);
conn.Open();
da.DeleteCommand.ExecuteNonQuery();
conn.Close();
da.DeleteCommand = new SqlCommand("delete from Quotations where ID ='" + ID + "'", conn);
conn.Open();
da.DeleteCommand.ExecuteNonQuery();
conn.Close();
Response.Write("nave");
}
It would be helpful to know which one ASP.NET technology you use. For example you can use ASHX to return any type of data which you need.
In general Response.Write append information to the response. You can use Response.ClearContent (or
Response.Clear) or Response.ClearHeaders to clear the current response. Moreover you can consider to set Response.ContentType to change the default"text/html"value to any other value like"text/plain"for example.You can use Fiddler, Firebug or “Network” tab of Developer Tools of Internet Explorer (press F12 to start) or Google Chrome to trace the HTTP traffic between jqGrid and the your Server.
You can use additionally ajaxDelOptions Ajax options like
ajaxDelOptions: {dataType: "text"}, but I think it’s not really required to solve your problem. I suppose that the origin of the problem is on the server side only (in your ASP.NET application).