Re: Http Module -Multiple Projects

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Preferably, you can make use of HttpModule and check the requested url for the username whether it is authenticated or not. This is one way of solving your problem.

But, I would suggest you to have a different approach which might well fit in your case.

1. Have a class called "BasePage" which is inherited from System.Web.UI.Page class.
2. Normally, all your WebForm classes would inherit the ASP.NET Page class. You have to change that to "BasePage" class.
3. Now, implement your authentication logic inside the BasePage class by overriding the Page_Load event.

If you implement the authentication code in HttpModule then you would end up in checking for all the page requests even if you dont need to authenticate a page. In this approach you have inherit the BasePage class for the webform's that are needed to be authenticated.

Let me know if you have any issues in understanding this solution.

--
Vadivel Kumar
http://www.vadivelk.net
vadi@online#2.vadivelk.net (remove "online#2.")

thomson wrote:
Hi All,
i do hae a solution in which i do have mulitple projects
including Web Projects,, Depending on the functionality it gets
redirected to different web projects and it is working fine,


for eg: http:DomainName/MainProject/index.aspx, If i login, it gets
redirectes to a different Web Project inside the solution like
http://DomainName/MainProject/ChildProject/MyPage.aspx..

This works perfectly fine.

My issue is
:


I need to add redirect a set of request to a different page based on
some criteria, for eg; i do have certain calls like
http://DomainName/username, when a request come like this i need to
authenticate the username with the database and redirect to a
dynamically constructed page which can be a different Web Project
inside the same solution.


Can anyone please guide me how do i solve this issue, should i use a
HTTP Module for this: since it has multipl;e projects i guess some
thing wrong

.



Relevant Pages

  • Re: Http Module -Multiple Projects
    ... You have to change that to "BasePage" class. ... implement your authentication logic inside the BasePage class by ... including Web Projects,, Depending on the functionality it gets ... I need to add redirect a set of request to a different page based on ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Redirect to default page using Windows Authentication
    ... The webserver may get intercept the request and return ... that error before I can do any type of redirect on the ... >authentication works is that if the resource you are ... >>confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: how to time out the web asp.net application when not in use for 15 minutes
    ... I really think you'll have an easier time adopting Forms authentication. ... > when the session is time out asp.net application goes to session_end ... > How do I redirect now? ... >> there's no request, there's no where to transfer to. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Gracefully Handling Logged Out User
    ... > Session has nothing to do with Forms Authentication. ... > automatically redirect them to the login page. ... > The one issue you'll see is that, if the request which required ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Http Module -Multiple Projects
    ... since i do have multiple Web Projects? ... I need to add redirect a set of request to a different page based on ... HTTP Module for this: since it has multipl;e projects i guess some ...
    (microsoft.public.dotnet.framework.aspnet)