Posts

Bind Content of page on scrolling using asp.net c#

Bind Content of page on scrolling using asp.net c#  .Aspx Page < head id ="Head1" runat ="server">     < title ></ title >     < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></ script >     < script >         $( function () {             InfiniteScroll();         });         function InfiniteScroll() {             $( '#divPostsLoader' ).html( '<img src="images/loader.gif">' );             //send a query to server side to present new content             $.ajax({    ...

Read and Write XML in asp.net C#

Read and Write XML in asp.net C# //Create a datatable to store XML data             DataTable DT = new DataTable ();             DT.Columns.Add( "FirstName" );             DT.Columns.Add( "LastName" );             DT.Columns.Add( "Gender" );             DT.Columns.Add( "Age" );             DT.Rows.Add( new object [] { "Sam" , "deol" , "male" , 20 });             DT.Rows.Add( new object [] { "kandy" , "deol" , "male" , 20 });             //Create a dataset           ...

Convert DataTabel to Json in Asp.net

 Convert DataTabel to Json in Asp.net protected void Page_Load( object sender, EventArgs e)     {         DataTable dt = DtTable();         string change = ReturnJSON (dt);             } public DataTable DtTable()     {         DataTable table = new DataTable () { TableName = "Customer" };         DataColumn keyColumn = table.Columns.Add( "Id" , typeof (System. Int32 ));         table.Columns.Add( "Name" , typeof (System. String ));         table.Columns.Add( "Address" , typeof (System. String ));         table.PrimaryKey = new DataColumn [] { keyColumn };         table.Rows.Add( ...

Call .Cs method on .Aspx Page

Call  .Cs method on .Aspx Page Step 1: Method on  .Cs page    public string GetFileName()         {             return "kandy" ;         } Step 2: Calling from .aspx Page     < script >         $(document).ready( function () {                        var Filename = ' <% = GetFileName() %> ' ;             debugger ;             alert(Filename);         });     </ script >

Convert DataTable to Xml and Vice-Versa

Convert DataTable to Xml and Vice-Versa     protected void Page_Load( object sender, EventArgs e)     {         DataTable dt = DtTable();         string change = ConvertDatatableToXML(dt);         DataTable dtret = ConvertXMLtoDataTable(change);     }         public string ConvertDatatableToXML( DataTable dt)     {         MemoryStream str = new MemoryStream ();         dt.WriteXml(str, true );         str.Seek(0, SeekOrigin .Begin);         StreamReader sr = new StreamReader (str);         string xmlstr;         xmlstr = sr.ReadToEnd(); ...

Move cursor on next control on complete filled

Image
Move cursor on next control on complete filled < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server">     < title ></ title >     < script type ="text/javascript">         function ChangeControl(CurrentControl, NextControl) {             debugger ;             if (CurrentControl.value.length >= CurrentControl.maxLength) {                 document.getElementById(NextControl).focus();             }         }     </ script >     < style type ="text/css">         .txtwidth     ...