Secure website using web.config

I want to secure my web app using web.config.

I've been all over the web and tried it all.

It's time for the experts.

My web.config:

    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />


  <add connectionString="data source=;UID=pfcu;PWD=betterbank;initial catalog=pfcu" providerName="System.Data.SqlClient" name="Sitefinity" />
    <!--<add connectionString="data source=DEVELOPMENT7\PFCU;UID=sa;PWD=1946isaac;initial catalog=pfcu" providerName="System.Data.SqlClient"  name="Sitefinity" />-->
                <add value="RatesSelector.aspx" />
        <ipSecurity allowUnlisted="false">
          <!-- this line blocks everybody, except those listed below -->
          <clear />
          <!-- removes all upstream restrictions -->
          <add ipAddress="" allowed="true" />
          <!-- allow requests from the local machine -->
          <add ipAddress="" allowed="true" />
          <!-- allow the specific IP of  -->
          <add ipAddress="" subnetMask="" allowed="true" />
          <!--allow network to>
          <add ipAddress="" subnetMask="" allowed="true" />
          <!--allow network to>
          <add ipAddress="" subnetMask="" allowed="true" />
          <!--allow entire /8 network of to>
          <basicAuthentication enabled="true" />
      <modules runAllManagedModulesForAllRequests="true" />
The error is attached.  Is there any other method I can use using c#
Under the gun

TechIsaacIT Contracting Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Maybe this will help

You cannot do it in the website web.config only.

If you can use IIS manager: Open IIS Manager, locate the site, click on the folder you want to protect, then click on IP address and Domain Restrinctions.

Also click on "Edit feature settings" in the right Actions panel" to specify actions for unspecified clients (i.e. Deny with Forbidden, or simply Deny With Not Found).

This will generate the right configuration for you.
Bob LearnedCommented:
Maybe being secure would mean not publishing your IP addresses on the public Internet...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.