Last post Dec 09, 2007 10:33 AM by albertpascual
Dec 08, 2007 12:52 PM|nima_dir|LINK
I want to some items in my site inaccessible when peoples not login in to site.
this items include photo,docs and ...
How i can do that using httphandlers
may any one explane that how IsReusable works when set to true or false?
thanks a lot
Dec 08, 2007 12:57 PM|albertpascual|LINK
A good place to start is a sample, find it below. You can also do that without an httphandler but a map file and user roles.
Hope this helps
Dec 08, 2007 01:04 PM|nima_dir|LINK
Thanks dear Albert
but is it possible that protect accessing photo that we say that place in this address:
I use Custom Login and membership and do not use .net membership
Dec 08, 2007 03:52 PM|albertpascual|LINK
Yes of course, you can do that, you can check the directories you are protecting at each request and redirect to the login page if the session you used to read the user name is not present.
Dec 09, 2007 09:38 AM|nima_dir|LINK
Dec 09, 2007 10:33 AM|albertpascual|LINK
void context_BeginRequest(object sender,
HttpApplication app = (HttpApplication)sender;
string encodings = app.Request.Headers.Get("Accept-Encoding");
// No encodings stop the HTTP Module processing
if (encodings ==
Check the rights to that directory
So you need to check by request, You always have the absoultePath so you can do a much better job comparing or you can keep a list of directories and rights
to compare, however whatever you want to do, that's the function you want to add your code.