- When a browser requests an HTML file, the server returns the file
- When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server
- The ASP.NET engine reads the file, line by line, and executes the scripts in the file
- Finally, the ASP.NET file is returned to the browser as plain HTML
public class GenericConverter { public static T Parse<T>(string sourceValue) where T : IConvertible { return (T)Convert.ChangeType(sourceValue, typeof(T)); } public static T Parse<T>(string sourceValue, IFormatProvider provider) where T : IConvertible { return (T)Convert.ChangeType(sourceValue, typeof(T), provider); } } public static class TConverter { public static T ChangeType<T>(object value) { return (T)ChangeType(typeof(T), value); } public static object ChangeType(Type t, object value) { TypeConverter tc = TypeDescriptor.GetConverter(t); return tc.ConvertFrom(value); } public static void RegisterTypeConverter<T, TC>() where TC : TypeConverter { TypeDescriptor.AddAttributes(typeof(T), new TypeConverterAttribute(typeof(TC))); } } ----------------
Comments
Post a Comment