How to edit the user details stored in aspnetdb without asp.net web administration tool? - asp.net-mvc

I have asp.net MVC application which uses asp.net membership. I configured the user details from local system using Asp.Net web site administration tool. Now I have deployed the site in server and I need to change the password. Now I have the ASPNETDB.MDF file in the App_Data folder.
How to edit the details?

Adding ASP.Net MVC Membership Starter Kit to your project is a great place to start, if you see ongoing edits being required.

You could do one of a couple of things. You can copy the MDF from the site to the local machine, and then change the details there, then copy the MDF back over, or you can implement a web page that changes the password using the SqlMembershipProvider.ChangePassword method.

You must call the method MembershipProvider.ChangePassword. See http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.changepassword.aspx.

Related

How to publish ASP.NET MVC on IIS server

I am struggling with trying to publish a site.
I have made a basic web site with ASP.NET MVC and I now want to host it on a pc.
I have opened ISI manager and added a new site. I set the default directly to the directly where the files for the site are stored but when i navigate to the pc I don't get my site. I get an IIS server error in application error.
What steps do i need to do to get the a basic site to run on the server.
First, you need to have installed iis, this is done you have to register the asp.net framework, for this you need to run a command line.
Go to cmd and type:
aspnet_regiis -i
Done so please enter
http:// localhost/AplicationName
If you get an error, then you should really post that error with your question. However, since the most common problem in the scenario you describe is permissions, I'm going to assume that that is your problem.
Unless you're going to put your code in a directory owned by IIS (such as "inetpub"), then you need to give the IIS user or group rights to the directory your code is in. You can do this by right-clicking the directory in Windows Explorer, and choosing "Properties". Then click the "Security" tab. Use the "Edit..." button to add the IIS user or group. It should be named something along the lines of "IIS_*". You'll need to grant full control, so just like any other publicly available directory (including "inetpub"), you should ensure that there's nothing secure or compromising in that directory.

how publish and view mvc website basic steps

First time I am trying to publish an mvc website. So far I have published it to a local folder and using IIS I have made the folder a virtual folder. How do I run the website from my browser and how to start it with Account/LogOn?
Here is the link of Video tutorial release by ScottGu regarding MVC deployment and study hope this will help you
http://weblogs.asp.net/scottgu/archive/2011/05/15/great-free-video-training-on-asp-net-web-forms-and-asp-net-mvc.aspx
There are many articles and tutorials out there about deploying ASP.NET MVC applications. Once IIS is configured you simply point your browser to http://localhost/NameOfTheApp/Home/Index and you should be ready to go.
First which version is there on remote server. For your account logon i am assuming that you are using default membership provider. I normally include membership provider table in my database. If you are running on IIS 6.0 then you have to made some changes as mentioned by Haacked on his blog. While publishing make sure that mvc dll in made copy local and is there on your bin folder on remote site. First publish the site on local and if it is running properly upload it on remote server set the connectionstring as told by your hosting provider

integrating YAF.NET in my MVC3 Razor Solution

I would like to know if there is a way to integrate YAF.NET to my MVC3 Application?
I dont want YAF to be inside my page like using my masterpage or stuff like that, I just want it to be in a subfolder like /forum and if a user clicks the "forum" link he will be redirected to the forum.
In the future I also would like to use a login system for my page, so I have to think about membership provider. I know that there is a way to make YAF use your basic asp.net membership provider but will yaf work with mvc 3 in that way? Since yaf isn't a .NET 4 application I wonder how I could migrate the membership provider?
If there isn't a solution for the membership stuff, I should be able to just link from my page to YAF?
EDIT:
My solution ->
1)I added a subdomain and config both of mine domains to use an A-Record which points to the Server where IIS is running.
2)I added 2 Websites. The first one is my Main Website with my MVC3 Application and the second one is the YAF.NET Forum.
3) I edited the binding settings of both of the websites (IIS Manager -> Sites -> yoursite -> Binding) and removed the IP binding insteed i added a HTTP header. For mainsite = mydomain.com and for the forum forum.mydomain.com
For the first part, you can just install YAF in a virtual directory on your website like www.mywebsite.com/forums/ and let it run standalone there.
Create a new Virtual Directory in the folder you like. (/forums)
Set permissions, .NET settings etc accordingly and install YAF there.
For the second, what you could do is use from your MVC app, directly read YAF's database of users (wherever it is) and use it to authenticate your users.
The Latest build of YAF is on ASP.net 3.5, you could try getting the source and building it for .NET4, although this would not be necessary since you said you don't want to mash your app with it but run it side-by-side and have them interop. (There also is some UserControl feature for CMS's you might want to check that out)
On the features page it says YAF supports asp.net memberships and roles, so you shouldn't have a problem there either.

How do I access the ASP.NET Configuration Tool when a site is live? This is ASP.NET MVC

I was wondering if it's possible to access the ASP.NET Configuration Tool once a site is live. To be able to create and edit users and roles is obviously very important, and from what I've been reading, once a site is deployed, the Configuration Tool is no longer accessible. If this is the case, HOW do I add users, etc.?
By the way, I found a User Management plugin which brings a lot of the Configuration Tool's capabilities to the front end of a User Management section of the deployed website, but it DOES NOT offer the capability to add a new user. Help??? Thanks!!
That all depends. If by "going live" you mean "Publishing the website and the database to a different computer through which you cannot access the database any longer", then yes. If you still have sql access (ie. you can run SQL Management Studio from your dev machien) the no you can access it by changing your web.config.
Alternatively, you can install Visual Studio express on your remote server and be able to access it from there.
The ASP.NET Configuration Tool GUI is not available once the site is live unless you have access to the database from your development machine.
All of the settings for user authentication can be modified via your web.config file.
You can add/edit users and roles via the Membership and Roles class in the System.Web.Security namespace.
1: Website admin tool is accessible via Visual Studio only.
2: You can access your membership database on live via WSAT by changing connectionstring in your web.config to point to your live membership db.
Apart from using WSAT, asp.net has CreateUser control which you can use to create user on live. This is the same control used by WSAT.
These links should help:
CreateUserWizard
Custom WSAT Tool
http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx

Best practices for deploying an MVC application on IIS7

I'm not a web admin, and I'm new to IIS. So, I'm looking for advice.
My MVC application (e.g. fooapp) is the default application for my site (e.g. foo.bar). I used IIS Manager to add the site to IIS7. When I import the application, IIS Manager wants to put it in it's own directory (/foo), and tells me I shouldn't put it in the base (site) directory. This means that to get to my default MVC view, I have to enter the URL http://foo.bar/fooapp/. Needless to say, I want to get there via http://foo.bar/
I see 2 possible solutions:
Add a default page to the site directory that redirects to the MVC app.
Ignore the IIS admonition and load the app into the site directory.
My IIS7 knowledge is limited. I have played around with some options (such as HTTP Redirect). Since nothing changed, I obviously don't understand what I'm doing.
Anyway, if there are some considered "best practices" and/or other suggestions, please let me know.
Tbh, I'm not sure why the IIS manager is trying to convince you to add it as a sub app.. Maybe you just didn't do it right >_>
I've got a couple servers running with IIS7/7.5 and they have apps running in the root of the website.. No problem there :)
You might want to create a new website in IIS (right click on websites, choose "Add Web Site"), point the "Physical Path" directly to the folder your website's stored in, and set the Host name to whatever host you use (foo.bar ? :) )
This should work just fine )
In terms of deployment, if you use VS2010 I'd really recomment looking at Web Deploy.. It's a new addon written for IIS7, and allows one-click publish to IIS directly from VS2010. I'm using it on my site and it works flawlessly :)
Check out Scott Hansellman's talk about it, or check it out in the IIS website

Resources