I have a .aspx page which I want the browser to treat like a regular .css file. The code in the .aspx looks like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
protected void Page_Init(object sender, EventArgs e)
{
Response.ContentType = "text/css";
}
</script>
@import url(<%= "myCs...
Hi, I am loading a image trough javascript:
myimage.src = "/mycontroller/mymethod";
myimage.alt = "image";
myimage.onload = function(){
$('body').append(myimage);
};
But, somethimes my controller method should return an error, with the http status 500. So, the content-type will not be "image/png" anymore. Will be text.
There's...
I would like to post a form using ajax and jquery to a .asmx webservice and return the value from the webservice as JSON.
I'm using ASP.NET 4.0. I know that in order to return JSON from a webservice the following needs to be set (1) dataType: "json" (2) contentType: "application/json; charset=utf-8", (3) type: "POST" (4) set the Data t...