Final resort for modifying your HTML output - Intro

In order to answer some queries from different sources I have decided to start a mini series describing various ways for modifying your HTML output for at .NET website. These techniques can be useful in at least the following situations 1. You want to modify some HTML generated by webcontrols that are not under your control 2. You want to fix some common error which is generated on your pages (i.e... [More]

Read metadata from images

Using the .NET 3.0 framework you can gain access to some of the metadata that is stored in images. What you need to do is add the following references to your project PresentationCore (part of the 3.0 framework)WindowsBase (Also part of the 3.0 framework) Then you can see from the following code how you can access some of the various properties found in the metadata   using System; usin... [More]

How to post a page using C#

If you should ever desire to do some webrequesting and posting some values to a webpage and afterwards reading the results. Then you can use the following snippet   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO; namespace PageScraper { class Program { static void Main(string[] args) ... [More]

Find control

In order to find a control on a page, which my be nested in a repeater or another control, this method might be useful private Control FindNestedControl(Control parent, string controlid) { Control c = parent.FindControl(controlid); if (c != null) return c; else { foreach (Control child in parent.Controls) { c = FindNestedControl(child, ... [More]

Execute global.asax methods always

In order to execute your methods in your global.asax file you need to modify your IIS configuration.  This is because .htm files are handled by the IIS without activating the .NET framework. In order to activate the framework when requesting other file types you should Open the IIS manager Navigate to your website Rightclick and select properties Select the "Home directo... [More]