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;
}
Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts
Wednesday, December 28, 2011
Ajax Page Response
Friday, September 9, 2011
How to render user control in asp.net with ajax
function yourfunction(val1) {
$.ajax({
type: "POST",
url: "..GetData.aspx",
data: 'param=ctlParam&qs=' + val1,
success: function (data) {
//do what you need
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
Use the code in .aspx page
Dim strparam As String = Request.Form("param")
Dim strResponse As String = ""
hshProperty.Add("qs", Convert.ToInt32(Request.Form("qs")))
strResponse = ViewManager.RenderUserControl("yourcontrol.ascx", hshProperty)
''qs will be property in yourcontrol.ascx
Response.Write(strResponse)
$.ajax({
type: "POST",
url: "..GetData.aspx",
data: 'param=ctlParam&qs=' + val1,
success: function (data) {
//do what you need
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
Use the code in .aspx page
Dim strparam As String = Request.Form("param")
Dim strResponse As String = ""
hshProperty.Add("qs", Convert.ToInt32(Request.Form("qs")))
strResponse = ViewManager.RenderUserControl("yourcontrol.ascx", hshProperty)
''qs will be property in yourcontrol.ascx
Response.Write(strResponse)
Subscribe to:
Posts (Atom)