Click here to Skip to main content
15,896,727 members
Articles / Web Development / ASP.NET

A Smart Form Control for ASP.NET URL Rewriting

Rate me:
Please Sign up or sign in to vote.
4.20/5 (8 votes)
20 Jul 2007CPOL3 min read 58.8K   457   39  
A smart form control that fixes many of the problems that are caused by extensionless URL rewriting in ASP.NET.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.Design;

namespace David.Nelson.UI.Web
{
    public class GenericControlDesigner : ControlDesigner
    {
        public GenericControlDesigner()
            : base()
        {
        }

        protected override string GetErrorDesignTimeHtml(Exception e)
        {
            // Write the error message text in red, bold.
            string errorRendering =
                "<span style=\"font-weight:bold; color:Red; \">hello" +
                e.Message + "<br>" + e.StackTrace + "</span>";

            return CreatePlaceHolderDesignTimeHtml(errorRendering);

        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
I have been doing web development for about 11 years. I specialize in Dynamic HTML, C#, and SQL database design.

Comments and Discussions