User in Web Site Administration Tool on IIS - asp.net

I'm new in ASP and IIS and I trying to solve this problem for 2 days but still can't get it.at 1st, I created a ASP login page and the user information store in Web Site Administration Tool (VS2008 Project>ASP.NET Configuration) It works fine as I can log in to my aspx page when I debug it.
Next, I turn on the window feature (IIS under item World Wide Web Services >> Application Development Features all are selected except CGI)
Then, I publish my login page and go to C:\inetpub\wwwroot\web.config add few lines
<connectionStrings>
<add name="connect" connectionString="Data Source=USER-PC\SQLEXPRESS;Initial Catalog=school;Persist Security Info=True;User ID=sa;Password=password" providerName="System.Data.SqlClient" />
<add connectionString="data source=.\SQLEXPRESS;IntegratedSecurity=True;AttachDBFilename=|DataDirectory|ASPNETDB.MDF;User Instance=true" name="ConnectionString" providerName="System.Data.SqlClient" />
<add name="ptiConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|pti.mdf;IntegratedSecurity=True;User Instance=True" providerName="System.Data.SqlClient" />
</connectionStrings>
Next, I open up IIS Manager enable ASP.NET Impersonation and i try to browse to localhost and I still unable to access to my login page
I also enable Form Authentication but still the same , can't login. Can Anyone help me ??

Did you install IIS after you installed ASP.NET? If so, you'll need to register ASP.NET with IIS - see my answer here: Hosting ASP.Net MVC 4 SPA web Application in IIS

Related

ASP.NET VB change db connection on web forms framework

I have created an instance of ASP.NET Web Forms in my Microsoft Visual Studio. By default the program generates user login page and registration which are linked to the .mdb file.
I want to reconfigure the standard connection and link it to my instance of MSSQL 2012 SQLExpress server.
How can I do it?
Ok so I will give some direction and link you to a page.
First let me ask you this the connection you are using presently is it in a web.config file. If so this is where you will change the server/instance and database/catalog name.
Web.Config modification for SQL Server Instance
or this link
Web Config modification for SQL Express 2
So if you in the web.config file you should see something similar to this.
<ConnectionStrings>
<add name="" connectionString="Server=(localhost)\SqlExpress;Max Pool Size=300;Initial Catalog=database;User ID=username;Password=password;" providerName="System.Data.SqlClient"/>
</Connectionstrings>
or
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source= (LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\database.mdf;Initial Catalog=database;Integrated Security=True" providerName="System.Data.SqlClient" />
you need to change the follow:
Server or Data Source
and
Initial Catalog or AttachDbFilename
Now your credentials you may use any username and password that has access to the sql server express instance.
I hope this helps.

asp .net mvc website login/register works on local but not on server .net 4.5.2 vs2105

I created an mvc website.
Framework: .net 4.5.2
visual studio 2105 community edition.
When I run project On my local machine, it works perfectly.
I try to use register and login pages, they are working perfectly as well. I can create new users and then login with them.
But when I copy project on server (Windows server 2012), project works perfectly but not register/login pages.
It gives error:
An error occurred while processing your request.
I copied App_Data folder as well. There is a .mdf file in it.
This is the connection string in web.config
add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-mvc1-20151111034033.mdf;Initial Catalog=aspnet-mvc1-20151111034033;Integrated Security=True"
providerName="System.Data.SqlClient"
Try to update the connection string
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=Server_Name;Initial Catalog=Database_Name;Integrated Security=True;User ID=Username;Password=Password;" />

Where does an "ASP.NET Web Application" project store user registration details?

When developing a website using a Visual Studio 2013 ASP.NET Web Application template, where does the user's information get stored when they register their details through the register.cshtml view page?
You create an MVC Web Application in VS 2013. At this moment, the database doesn't exist. But when you run the application on localhost and register a user, the database is created.
To find its name, look in web.config:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-WebApplication2-20150615111350.mdf;Initial Catalog=aspnet-WebApplication2-20150615111350;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
To find its location, look in the App_Data folder:
You can use also SQL Server Management Studio for managing this database.

cant access the local database

I host ASP.Net (MVC4) web site on Somee.com, but when i try to login to the web site its give an error please help me out to fix this matter thank you.
This is my "connectionStrings"
<connectionStrings>
<add name="GuestDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\HMS.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
This is the message that i get every time
My website -http://www.brownhotel.somee.com/

mvc4 authorisation doesn't work with ASP.net Configuration

I am following along this series:
http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-entity-framework/using-web-api-with-entity-framework,-part-1
It all goes well up to the point, where one is requiered to use the ASP.net Configuration tool to create a role Administrator, a user and then log in.
[Authorize(Roles="Administrator")]
works fine, but I can't log in with the "Admin" account created via ASP.NET configuration; or, vice versa, see the users which I registered in the demo on the ASP.NET configuration panel.
And why did this demo create 2 Connectionstrings to two differend databases?
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WebStore-20120820081613;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WebStore-20120820081613.mdf" providerName="System.Data.SqlClient" />
<add name="OrdersContext" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=OrdersContext-20120820083248; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|OrdersContext-20120820083248.mdf" providerName="System.Data.SqlClient" />
I'm running the whole thing on Windows Server 2008 R2; Visual Studio Express 12.
I've solved the issue by recreating the application with visual studio 2010.
... copied the connectionstring to the vs2010 project and voilá ... done.

Resources