Archive

Archive for July, 2010

Introduction To Sub Sonic With Asp.net (Data Access Layer)

Display Loading Image Using Jquery Ajax Methods in Asp.net

Often we need to display a loading indicator whenever an ajax request is done. To accomplish this you can look at the following code:

<script src=”http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>

<script language="javascript">

$(document).ready(function() {
$("# btnGetName ").click(function() {
 $.ajax({
 type: "POST",
 url: “../Default.aspx/GetName",
 data: "{}",
 contentType: "application/json; charset=utf-8",
 dataType: "json",
 success: function(msg) {
 $("# divName ").html(msg.d);
 }
 });
 });
$("# loading ").ajaxStart(function() {
$(this).show();
});
$("# loading ").ajaxStop(function() {
$(this).hide();
});
});
</script>
<pre>
</pre>
<body>
<form id="form1" runat="server">

 <div id="loading" align="center" style="padding-right: 25px; z-index: 3; padding-left: 25px;
 left: 45%; top: 45%; padding-bottom: 15px; padding-top: 15px; position: absolute;">
 <img alt="Loading..." id="ImgLoader" runat="server" src="loader.gif" />
 </div>

 <div id="divName"></div><input id="btnGetName" type="button" value="Get Name" /></div>

</form>
</body>

Asp.net Custom Validator and Jquery $.ajax()

When we are using custom validation and making Ajax call using jquery library, custom validation function always returns true. We can fix this, jQuery’s $.ajax() function has a handy option: async, which when set to false does what we need – it waits for the response from the server before continuing to our success function.

For detailed description with example visit:

http://brian.dobberteen.com/other-stuff/jquery_ajax_custom_validator/

http://stackoverflow.com/questions/928309/jquery-and-asp-net-custom-validator

Tree View Control using Jquery (DynaTree), Asp.net

July 5, 2010 2 comments

Below are some links for Using Jquery, Obout Treeview Control with asp.net

Using Jquery

http://wwwendt.de/tech/dynatree/

http://www.codeproject.com/KB/aspnet/LazyTree.aspx

Using Obout

http://www.obout.com/t2/index.aspx