So I have the following code:
$(document).on('click', 'a[data-link]', function () {
var $this = $(this);
url = $this.data('link');
$("#imagePreview").load("imageProcess.aspx?" + url);
});
This is supposed to send GET data into imageProcess.aspx, and then append the output to the div id “imagePreview”. url stores data from here:
<a class='modelsBlue' href = '#' data-link='model="+$(this).find('model').text()+"&type="+category+"'>" + $(this).find("model").text() + "</a>
The problem I’m running into is that nothing is being displayed when I run this code. For right now my .aspx file holds just this:
<%
Response.Write(Request.QueryString("model"))
Response.Write(Request.QueryString("type"))
%>
I’m very new to asp.net coming from a php background, so I’m certain that the problem lies in the asp file, but I’ve been looking online for a solution and I haven’t been able to find anything. Any help is much appreciated.
An image is a stream over HTTP, or might be embedded in an HTML document using base64 encoding. What are you returning back from
imageProcess.aspxfile? Do you set properContent-Typeheaders in HTTP response (things likeimage/pngorimage/jpg)?Update: I recommend that you first get sure that where the problem is. Install Fiddler and run your code. See the HTTP traffic through Fiddler. This way, you can see what has been returned back by server (you can see HTTP response body). If nothing is sent back, then the problem is in server. If something is sent back, but not shown, then of course you have to check the client.