DCSIMG
Framework 2.0,C# - Gilad Lavian's Blog

Gilad Lavian's Blog

In Development

Browse by Tags

All Tags » Framework 2.0 » C# (RSS)
CompositeControl or WebControl
Whenever possible, i rather to use UserControl instead of WebControl, since WebControls are more complicate to create and later on to maintain. But in case that i have to build a WebControl, i rather build a CompositeControl. Way CompositeControl? CompositeControl eventually inherit from WebControl, but each control inside the CompositeControl manage its own life cycle events and the ViewState / PostBack data. This means that we going to save a lots of code writing by not handling this events our...
Populate Hierarchical Controls Using Database
ASP.NET offers some nice tools to use with our common web sites development. Some of them is the Menu and TreeView controls.   Consider the following SQL Table:         lets say I want to display all the child categories under there parent categories in a nice DHTML menu.   First Step - Add a Menu control to the ASPX file. < asp:Menu runat ="server" ID ="Menu1" > < DataBindings > < asp:MenuItemBinding TextField ="CategoryName"...
Visual Studio 2005 Recent Projects Manager
I didn't find a way to delete projects from my Recent Projects List in visual studio 2005, so I made this Add-In to manage them. Place the 2 files in the RecentProjectsManager.zip (Attached) into the Add-In folder: MyDocuments\Visual Studio 2005\Addins Load the visual studio, click "Tools" and then "Recent Projects Manager" Please let me know about any problems you encountered: gilad.lavian@gmail.com
C# IRC Client API
Here is a little IRC API that I wrote allows you to connect to IRC server easily. The syntax to create the IrcClient is: 1: //Set the server details 2: ServerInfo serverInfo = new ServerInfo( "irc.mircx.co.il" , 6667, "GiladBot" , "Gilad C# Bot" , "gilad.lavian@gmail.com" , "#test" ); 3: 4: //Create a IrcClient 5: IrcClient ircClient = IrcClientFactory.CreateIrcClient(serverInfo); 6: 7: //Subscribe to the irc server events 8: ircClient.OnServerText...
Transform an XML to HTML - StringReader
Here is a great way to transform an XML string returned from DB Query to a HTML using DataGrid/List... The xml represent by the StringReader, witch implements a TextReader that reads from a string. Then loaded to DataSet (by ds.ReadXML), and finally binds to the DataGrid. //Supposed this is the text returning from DB... string xml = "<rows><row id='1'><name>Gilad</name><address>Burla</address>" + "<country>Israel</country><...