top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

how to allow only particular user to access website and deny all other users in ASP.NET?

+2 votes
301 views
how to allow only particular user to access website and deny all other users in ASP.NET?
posted Dec 23, 2014 by Sathyasree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In this situation we need to write the code like this

<configuration>
<system.web>
<authentication mode="Forms"/>
<authorization>
<deny users="?"/>  <!--This will restrict anonymous user access-->
</authorization>
</system.web>
<location path="Registration.aspx"> <!-- Path of your Registration.aspx page -->
<system.web>
<authorization>
<allow users="*"/> <!-- This will allow users to access to everyone to Registeration.aspx-->
</authorization>
</system.web>
</location>
</configuration>
answer Dec 23, 2014 by Vrije Mani Upadhyay
Similar Questions
+1 vote

This example shows you how to check given input contains only numbers (digits) or not using regular expression in asp.net and c#.

Regular expression
string strRegexpNumber = @"^[0-9 ]*$";

...