I have an html button in my asp.net page.
When I click on this button it calls an jquery to replace the contents of a <div>
with a moving gif progress bar. Whilst this is showing I also want to call another web method that will load a sprite into that same <div>
therefore replacing the progress bar with my images(s).
I got the progress bar showing but a bit lost as to how to continue in code getting the next bit.
Here is what i have so far...
In markup
<div id="divTest"></div>
<input id="Button1" type="button" value="button" />
<script type="text/javascript">
$("#<%=btnPlay.ClientID%>").click(function () {
$.ajax({
type: "POST",
url: "Feed2.aspx/Test",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
$("#divTest").html(msg.d);
//OK gif is now showing. Now i want to call another web method.
}
});
});
</script>
in code behind
[WebMethod]
public static string test()
{
string _div = "<div id=\"divBsy\" class=\"background\" style=\"background-position: center center;";
_div = _div + "background-image: url('../Images/ajax-loader.gif'); height: 394px; width: 633px;";
_div = _div + "background-repeat: no-repeat;\" align=\"center\">";
_div = _div + "</div>";
return _div;
}