System.Web.UI.UserControlParser.GetCompiledType C# (CSharp) Method

GetCompiledType() static private method

static private GetCompiledType ( TextReader reader, int inputHashCode, HttpContext context ) : Type
reader System.IO.TextReader
inputHashCode int
context HttpContext
return System.Type
		internal static Type GetCompiledType (TextReader reader, int? inputHashCode, HttpContext context)
		{
			UserControlParser ucp = new UserControlParser (reader, inputHashCode, context);
			return ucp.CompileIntoType ();
		}
#endif

Same methods

UserControlParser::GetCompiledType ( string virtualPath, string inputFile, ArrayList deps, HttpContext context ) : Type
UserControlParser::GetCompiledType ( string virtualPath, string inputFile, HttpContext context ) : Type

Usage Example

Example #1
0
        /*
         * Compile an .ascx file into a UserControl derived Type
         */
        internal static Type GetCompiledUserControlType(string virtualPath,
                                                        string inputFile, HttpContext context)
        {
            CheckUserControlFileExtension(virtualPath);

            // We need unrestricted permission to process the UserControl file
            InternalSecurityPermissions.Unrestricted.Assert();

            UserControlParser parser = new UserControlParser();

            Type t = null;

            // Suspend client impersonation (for compilation)
            HttpContext.ImpersonationSuspendContext ictx = context.Impersonation.SuspendIfClient();

            try {
                try {
                    t = parser.GetCompiledType(virtualPath, inputFile, context);
                }
                finally {
                    // Resume client impersonation
                    ictx.Resume();
                }
            }
            catch { throw; } // Prevent Exception Filter Security Issue (ASURT 122835)

            return(t);
        }
All Usage Examples Of System.Web.UI.UserControlParser::GetCompiledType