Posts

Showing posts from July, 2011

Create TreeView Structure From Data Table in ASP.Net

One of my friend want to convert Datatable to Tree Structure, hope this will help you. class Program { static void Main(string[] args) { try { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Id", Type.GetType("System.Int32"))); dt.Columns.Add(new DataColumn("Name")); dt.Columns.Add(new DataColumn("ParentNodeId", Type.GetType("System.Int32"))); DataRow dr = dt.NewRow(); dr[0] = "1"; dr[1] = "Number 1"; dr[2] = "0"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "2"; dr[1] = "Number 2"; dr[2] = "1"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "3"; dr[1] = "Number 3"; dr[2] = "2"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "4"; dr[1] = "Number 4"; dr[2] = "1"; dt.Rows.Add(dr); new CreateTreeNode(dt, "Id", "Name"...

Are you making these 3 common ASP.NET AJAX mistakes?

I found the very usefull link for those who working with AJAX Controls in ASP.Net http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/

How to disable multiple upload button for Document List in Sharepoint 2010

Open upload.aspx file in Visual Studio, upload.aspx file found this file in "14\TEMPLATE\LAYOUTS" folder. Search for "if (hideLink)" statement , you have to set hideLink variable to true for hiding the multiple upload button. hideLink =yourJavaScriptFunction(); if ( hideLink) ... 3. replace yourJavaScriptFunction with your javascript function which returns bool value.

How to Create Event Handler In Sharepoint ?

Open Visual Studio 2010. On the File menu -> New and then click on Project. In project type, select Event Receiver. Enter Name of Event Receiver , click on Ok button. Now you get Sharepoint Customization Wizard, Choose Deploy as a Sandboxed solution, click on Next. In Choose Event Receiver Settings window, Select List Item Events from What type of event receiver do you want? dropdown. In What item should be the event source ? dropdown, choose type of List on which you want Event Receiver. Next Choose event on which you want to write code and click on finish Event Receiver file is created and method for selected event is appeared. Press F5 for deploy this solution.