Wednesday, December 28, 2011

Ajax Page Response

        var temp = document.getElementById("dvDiv").innerHTML;
document.getElementById("dvDiv").innerHTML = "<span style='verticle-align:middle;color:#FF5500;font-family:verdana;word-spacing:4px'><img src='../images/loading.gif' /><strong>wait...</strong></span>";

//Show loading message with image


var xmlhttp = GetXMLRequestObject();
var Rurl = "Page.aspx?qs=your query string here" ;
xmlhttp.open('POST', Rurl, true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(SomeId);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
var responseText = xmlhttp.responseText;
document.getElementById("dvDiv").innerHTML = responseText; //Show the response here
}
}

xmlhttp = null;
}

Wednesday, December 7, 2011

Image with HomeURL

<img src="<%= YourProjectBase.YourConfigUtility.HomeURL %>yourfolder/images/<%# Eval("ImageName")%>.png" alt="" width="17" height="21" align="left" />