ASP.NET Sample Code
-
How to get information about the current browser
by Edward Tanguay
This code shows you how ASP.NET simplifies information about the current browser into class properites. There are others but these are the most useful.
-
How to write to an XML file
by Edward Tanguay
Writing to XML files is quite easy in ASP.NET as there are so many objects prepared for you -- you just need the syntax on how to use them. This code shows you how to write a simple member XML file.
-
How to get the current SessionID
by Edward Tanguay
Demonstrates how to retrieve the current SessionID for storing session data in a database
-
How to validate an XML file with an XSD file
by Edward Tanguay
Demonstrates an ASP.NET Web Form which tells you if your file is not well-formed and then if it is not valid it lists out the specific reason (like in XMLSpy), quite helpful to find an error in a large XML file as it returns the line number on which the error occurred as well as the tag name.
-
Serialize and deserialize objects to an XML file
by Edward Tanguay
This code shows the simplest way to automatically convert the information in an object to an XML file and back into an object. This is useful if you need to make information available web-server like on your server for other applications to pick it up.
-
How to write an ASHX file
by Edward Tanguay
An example of using a web handler file which you can use when your output is not going to a browser but to an xml-consuming client of some kind, keeping you away from all the browser technology you don't need.