Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
im creating a search site and i wanna restrict the users to view only certain sites so when the user enters a site(eg,fb) it should show a error or popup message and show take a screen shot and send it to the admin.
Posted
Comments
DamithSL 3-Jan-15 0:26am    
can you update the question with your site search code? where you have stored those restricted sites?

It is apparent that there would be absolutely no point to create some Web pages restricted to absolutely all users. It means that you want to restrict some resources for some users and make them available for others. Isn't that logical? If so, it really means that the users should be authenticated. You can start with learning ASP.NET starting, for example, here:
http://msdn.microsoft.com/en-us/library/eeyk640h%28v=vs.140%29.aspx[^],
http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#auth[^],
http://www.asp.net/web-api/overview/security/basic-authentication[^].

This CodeProject article can also be useful: ASP.NET authentication and authorization[^].

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Jan-15 23:23pm    
Even if I did not get something, this is because you did not properly explain it. Now, please tell me: who needs the site which is restricted unconditionally? Why showing popup message (bad idea, pop-ups could be disabled by many users)? Just show some content on the page (even empty). When I answered your question, I reasonably assumed that you are familiar with Web development basics (otherwise you should be busy learning then instead of asking such questions).

Why, why the admin should be informed on each unsuccessful attempt to access some page? Do you want to exterminate system admins (because no one can stand such a torture)? It looks like you need to understand what you have asked yourself.

And finally, "that this particular user has tried to search something unrelated" suggests that you are aiming to put handcuffs on some users. This is so bad from the ethical point of view (and would be quite stupid from the business point of view) that I, of course, won't discuss anything like that. Just don't do evil.

—SA
I agree with Sergey. 😊

My advice to you is that don't even show the results which are unrelated. As simple as that. Show only those which are accessible. That's it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900