Tuesday, June 23, 2009

ASP.NET

Working in Nic
Working in Nic Edit Maskfunction mask(str,textbox,loc,delim){var locs = loc.split(',');for (var i = 0; i <= locs.length; i++){for (var k = 0; k <= str.length; k++){if (k == locs[i]){if (str.substring(k, k+1) != delim){str = str.substring(0,k) + delim + str.substring(k,str.length)}}}}textbox.value = str}

Steps of Collection Class
class Leaf {private int intAge;private String strName;// Default Constructor public Leaf() {}// gets and sets the age valuepublic int Age {get {return intAge;}set {intAge = value;}}// gets and sets the strName variablepublic string Name {get {return strName;}set {strName = value;}}}

Object Oriented Programming
An object-oriented programming language (also called an OO language) is one that allows or encourages, to some degree, object-oriented programming techniques such as encapsulation, inheritance, modularity, and polymorphism

Working in ListView Control
ListView control is a new control added into ASP.NET 3.5. It enables you to display data in a format specified by you using templates and styles. It is useful for data in any repeating structure just like DataList and Repeater controls. However, unlike those controls ListView control enable you to edit, insert, delete, sort, paginate data without any extra effortStep 1stFirst create a new .aspx page and go to design view. Go to Data tab of the Toolbox and drag ListView control to your page. Now again go to the Data tab and drag LinqDataSource control to the page. Now configure the LinqDataSource control as described in Make sure that you have selected Enable Delete, Enable Insert and Enable Update checkbox from the smart tag of the LinqDataSource control as displayed in the picture belowStep 2ndNow open the smart tag of the ListView control and choose the Data Source as the LinqDataSource as displayed in the picture below.Step 3rdNow click on Configure ListView … from the smart tag of the Listview. Select Tiled from Layout, Professional from Style and Enable Editing, Enable Inserting, Enable Deleting and Enable Paging from the Options as displayed in the picture below. In the Enable Paging dropdown you may select Next/Previous pager or Numeric pagerStep 4thNow Save your files and press F5 to run. You should see an Insert form in your browsers. Just enter few records, try editing, deleting records. Once the number of records will exceed the PageSize of the DataPagers (that will be automatically inserted into ListView when you will select Enable Paging from the Configure ListView dialogue box) First, Previous, Next and Last button at the bottom will be enabled automatically.Hope you enjoyed playing with ListView and LinqDataSource control. Do let me know if you have any comments or suggestions. Thanks and Happy Coding !!!