Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Protection of specific files in local
Message
From
07/07/2006 05:45:32
 
 
To
06/07/2006 13:10:53
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133718
Message ID:
01134376
Views:
16
Hi,

The approach you're looking at in the other thread might work (Context.Handler.GetType().??? in Application_PreRequestHandlerExecute may be what you need).

But I wonder whether you would be better off subclassing the page class for use with the framework and passing the page to the framework somewhere during the page creation. That way only valid pages (in fact only pages deliberately subclassed) would be passed to the framework. (Sorry, I'm a bit rusty on this and have my head in a VFP bucket at the moment so I may be missing something (or a lot<s>)

Regards,
Viv



>>I said Web.config not Machine.config.
>>In my C:\WINNT\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config I see
>>
>><httpHandlers>
>>    <add path="*.config" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" />
>>....
>></httpHandlers>
>>
>>
>>That's the line I suggested you would neeed to remove.
>
>Ok, I was not aware there was also a web.config file at that level. Well, without changing anything in there, I would achieve want I want if I would comment some lines in the global.asax file. The problem is that file is conflicting with the web.config settings. Here is the global.asax file:
>
>
><object id="LXFramework" runat="server" class="Framework.Framework.App" scope="Application" />
>
><script runat=server>
>
>    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
>        LXFramework.nApplicationMode = 3
>        LXFramework.oServer = Server
>        LXFramework.Initialize()
>    End Sub
>
>    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
>        LXFramework.oRequest = Request
>        LXFramework.oResponse = Response
>        LXFramework.oServer = Server
>        LXFramework.BeginRequest()
>    End Sub
>
>    Sub Application_EndRequest(ByVal sender As Object, ByVal e As EventArgs)
>        LXFramework.oResponse.Write(LXFramework.GetJavascriptMessage)
>        LXFramework.EndRequest()
>    End Sub
>
>    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
>        LXFramework.ErrorSetup()
>    End Sub
>
>    Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
>        Dim loPage As System.Web.UI.Page = Context.Handler
>        LXFramework.oPage = loPage
>    End Sub
>
></script>
>
>
>Basically, if I comment the lines in the BeginRequest(), EndRequest(), Error() and PreRequestHandlerExecute() events, when a user pulls out the web.config or a .vb file such as account.aspx.vb, the server will return the proper message which is "This type of page is not served.". This is what I want. However, I really need to have global.asax to be defined as is. What happens is those events take priority over the web.config and they try to process the file. Do you know what I need to do in order to have the web.config to have priority?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform