1. FYI, I downloaded the zip file and there is a sln file, but no proj file. So the sln does not open. You might want to fix that so other users can open it easily.
2. Have you looked at the SimpleMembership provider that MS has provided in Webmatrix? Does your provider support what they are doing in that class?
I am having trouble setting up a MVC3 beta release project that has all of the Razor Helpers available. Could you give me a pointer or two?
What trouble? Are you using Razor? Don't forget, there's no intellisense support for that yet.
I just used EF to create a model based on Northwind, put this in the controller:
public ActionResult Index()
{
NorthwindEntities db = new NorthwindEntities();
var data = db.Products.Where(p => p.Discontinued == false);
ViewModel.Data = data;
return View();
}
I guess I can't use an _AppStart.cshtml, that is a Webmatrix thing.
So I added the line to the Global.asax.cs file in the Application_Start method and am getting this error.
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">Error15'System.Web.WebPages.WebSecurity' does not contain a definition for 'InitializeDatabaseFile'E:\Source\DotNet4\TPS\MvcApplication2\MvcApplication2\Global.asax.cs3916
MvcApplication2</div> <div></div>
Error15'System.Web.WebPages.WebSecurity' does not contain a definition for 'InitializeDatabaseFile'E:\Source\DotNet4\TPS\MvcApplication2\MvcApplication2\Global.asax.cs3916MvcApplication2
TPS
Member
215 Points
134 Posts
SimpleMembership - Only in WebMatrix?
Oct 25, 2010 02:54 PM|LINK
Does anyone know if we will be able to use SimpleMembership in any of the other platforms such as MVC3, Webforms?
Thank you.
Terrence
SimpleMembership
Terrence
ErikEJ
Member
186 Points
33 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 05:23 PM|LINK
I have implemented a Membership provider for SQL Server Compact 4, which works with ASP.NET (WebForms, MVC etc.) -
http://sqlcemembership.codeplex.com/
Mikesdotnett...
All-Star
154955 Points
19872 Posts
Moderator
MVP
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 05:48 PM|LINK
All the Helpers from WebMatrix are available in MVC 3. The WebGrid is particularly useful.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
TPS
Member
215 Points
134 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 05:49 PM|LINK
Thanks Erik
1. FYI, I downloaded the zip file and there is a sln file, but no proj file. So the sln does not open. You might want to fix that so other users can open it easily.
2. Have you looked at the SimpleMembership provider that MS has provided in Webmatrix? Does your provider support what they are doing in that class?
3. Thanks, I will check out your code.
Terrence
TPS
Member
215 Points
134 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 05:59 PM|LINK
Wow, that is great news.
I am having trouble setting up a MVC3 beta release project that has all of the Razor Helpers available. Could you give me a pointer or two?
Thanks.
Terrence
Terrence
ErikEJ
Member
186 Points
33 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 06:03 PM|LINK
1. It is a "Website", so there is no project file, just a folder.
2. No, my provider implements the standard "Membership" api.
TPS
Member
215 Points
134 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 06:05 PM|LINK
Thanks Erik.
Terrence
Mikesdotnett...
All-Star
154955 Points
19872 Posts
Moderator
MVP
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 06:09 PM|LINK
What trouble? Are you using Razor? Don't forget, there's no intellisense support for that yet.
I just used EF to create a model based on Northwind, put this in the controller:
public ActionResult Index() { NorthwindEntities db = new NorthwindEntities(); var data = db.Products.Where(p => p.Discontinued == false); ViewModel.Data = data; return View(); }And then this in the View:
@{ var grid = new WebGrid(View.Data, rowsPerPage: 20); } <div id="grid"> @grid.GetHtml( tableStyle: "table", headerStyle: "table_head", alternatingRowStyle: "altrow", selectedRowStyle: "selrow", columns: grid.Columns( grid.Column(header: "Select", format:@<text>@item.GetSelectLink()</text>), grid.Column("ProductName", header: "Product"), grid.Column("QuantityPerUnit", header: "Quantity Per Unit"), grid.Column("UnitPrice", header: "Unit Price", format: @<text>@item.UnitPrice.ToString("c")</text>), grid.Column("UnitsInStock", header: "# In Stock") ) ) </div>Works fine.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
TPS
Member
215 Points
134 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 06:16 PM|LINK
I am interested in getting SimpleMembershihp working.
I want to add the line below to the _AppStart.cshtml file, like Matt is doing in his blog
Using SimpleMembership With ASP.NET WebPages
http://blog.osbornm.com/archive/2010/07/21/using-simplemembership-with-asp.net-webpages.aspx
WebSecurity.InitializeDatabaseFile("SecurityDemo.sdf", "Users", "UserID", "Username", true);
I guess I may be bumping into the existing aspnet provider that is defaulted to a new project.
Any tips on getting SimpleMembership provider up and running in MVC3?
Thanks Mike.
Terrence
TPS
Member
215 Points
134 Posts
Re: SimpleMembership - Only in WebMatrix?
Oct 25, 2010 06:42 PM|LINK
I guess I can't use an _AppStart.cshtml, that is a Webmatrix thing.
So I added the line to the Global.asax.cs file in the Application_Start method and am getting this error.
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">Error 15 'System.Web.WebPages.WebSecurity' does not contain a definition for 'InitializeDatabaseFile' E:\Source\DotNet4\TPS\MvcApplication2\MvcApplication2\Global.asax.cs 39 16 MvcApplication2</div> <div></div>Error 15 'System.Web.WebPages.WebSecurity' does not contain a definition for 'InitializeDatabaseFile' E:\Source\DotNet4\TPS\MvcApplication2\MvcApplication2\Global.asax.cs 39 16 MvcApplication2
<div></div><div>Ideas?</div>
Terrence