浏览代码

Added automatic Database Migration on startup.

Moved Models and ViewModels into their respective Areas.
Added Groups/Roles to models.
tags/2.0.3
Teknikode 4 年前
父节点
当前提交
039fe574d6

+ 1
- 1
Teknik/App_Start/BundleConfig.cs 查看文件

@@ -30,7 +30,7 @@ namespace Teknik
bundles.Add(new ScriptBundle("~/bundles/common").Include(
"~/Scripts/common.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
bundles.Add(new StyleBundle("~/Content/CSS/Common").Include(
"~/Content/CSS/bootstrap.css",
"~/Content/CSS/font-awesome.css",
"~/Content/CSS/Site.css"));

Teknik/Models/Blog.cs → Teknik/Areas/Blog/Models/Blog.cs 查看文件

@@ -1,7 +1,8 @@
using System;
using System.Collections.Generic;
using Teknik.Areas.Profile.Models;

namespace Teknik.Models
namespace Teknik.Areas.Blog.Models
{
public class Blog
{

Teknik/Models/Post.cs → Teknik/Areas/Blog/Models/Post.cs 查看文件

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Teknik.Models
namespace Teknik.Areas.Blog.Models
{
public class Post
{

+ 1
- 0
Teknik/Areas/Home/Controllers/HomeController.cs 查看文件

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Blog.Models;
using Teknik.Controllers;
using Teknik.Models;


+ 1
- 1
Teknik/Areas/Home/Views/Home/Index.cshtml 查看文件

@@ -1,4 +1,4 @@
@using Teknik.Models
@using Teknik.Areas.Blog.Models
<div class="container">
<div class="row">
<center>

+ 81
- 0
Teknik/Areas/Profile/Controllers/ProfileController.cs 查看文件

@@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using Teknik.Areas.Profile.ViewModels;
using Teknik.Controllers;
using Teknik.Models;
using Teknik.ViewModels;

namespace Teknik.Areas.Profile.Controllers
{
public class ProfileController : DefaultController
{
private TeknikEntities db = new TeknikEntities();

// GET: Profile/Profile
public ActionResult Index()
{
ViewBag.Title = Config.Title + " - Profile";
ViewBag.Message = "View Your Profile";

return View();
}

[HttpGet]
[AllowAnonymous]
// GET: Profile
public ActionResult Login()
{
return View();
}

[HttpPost]
[AllowAnonymous]
public ActionResult Login(LoginViewModel model)
{
if (ModelState.IsValid)
{
if (model.IsValid())
{
FormsAuthentication.SetAuthCookie(model.Username, model.RememberMe);
return Json(new { result = "true" });
}
}
return Json(new { error = "Invalid User name or Password." });
}

public ActionResult Logout()
{
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home", new { Area = "Home" });
}

[HttpPost]
[AllowAnonymous]
public ActionResult Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
var foundUser = db.Users.Where(b => b.Username == model.Username);
if (foundUser.Any())
{
return Json(new { error = "That username already exists." });
}
if (model.Password != model.ConfirmPassword)
{
return Json(new { error = "Passwords must match." });
}
if (model.Insert())
{
return RedirectToAction("Login", "Profile", new LoginViewModel { Username = model.Username, Password = model.Password });
}
return Json(new { error = "You must include all fields." });
}
return Json(new { error = "You must include all fields." });
}

}
}

+ 14
- 0
Teknik/Areas/Profile/Models/AuthUser.cs 查看文件

@@ -0,0 +1,14 @@
using Microsoft.AspNet.Identity.EntityFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public class AuthUser : IdentityUser
{
public User User { get; set; }
}
}

+ 19
- 0
Teknik/Areas/Profile/Models/Group.cs 查看文件

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public class Group
{
public int GroupId { get; set; }

public string Name { get; set; }

public string Description { get; set; }

public List<Role> Roles { get; set; }
}
}

+ 15
- 0
Teknik/Areas/Profile/Models/PermissionTarget.cs 查看文件

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public enum PermissionTarget
{
Blog,
User,
Profile
}
}

+ 15
- 0
Teknik/Areas/Profile/Models/PermissionType.cs 查看文件

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public enum PermissionType
{
Add,
Edit,
Delete
}
}

+ 21
- 0
Teknik/Areas/Profile/Models/Role.cs 查看文件

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public class Role
{
public int RoleId { get; set; }

public string Name { get; set; }

public string Description { get; set; }

public PermissionType Permission { get; set; }

public PermissionTarget Target { get; set; }
}
}

Teknik/Models/User.cs → Teknik/Areas/Profile/Models/User.cs 查看文件

@@ -1,8 +1,9 @@
using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Collections.Generic;

namespace Teknik.Models
namespace Teknik.Areas.Profile.Models
{
public class User
{
@@ -16,12 +17,15 @@ namespace Teknik.Models

public DateTime LastSeen { get; set; }

public List<Group> Groups { get; set; }

public User()
{
Username = String.Empty;
HashedPassword = String.Empty;
JoinDate = DateTime.Now;
LastSeen = DateTime.Now;
Groups = new List<Group>();
}
}
}

+ 12
- 0
Teknik/Areas/Profile/Models/UserIdentity.cs 查看文件

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Areas.Profile.Models
{
public class UserIdentity : User
{
}
}

+ 33
- 0
Teknik/Areas/Profile/ProfileAreaRegistration.cs 查看文件

@@ -0,0 +1,33 @@
using System.Web.Mvc;

namespace Teknik.Areas.Profile
{
public class ProfileAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Profile";
}
}

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapSubdomainRoute(
"Profile_dev", // Route name
"dev",
"Profile/{controller}/{action}", // URL with parameters
new { controller = "Profile", action = "Index" }, // Parameter defaults
new[] { typeof(Controllers.ProfileController).Namespace }
);
context.MapSubdomainRoute(
"Profile_default", // Route name
"profile",
"{controller}/{action}", // URL with parameters
new { controller = "Profile", action = "Index" }, // Parameter defaults
new[] { typeof(Controllers.ProfileController).Namespace }
);
}
}
}

Teknik/ViewModels/LoginViewModel.cs → Teknik/Areas/Profile/ViewModels/LoginViewModel.cs 查看文件

@@ -7,7 +7,7 @@ using System.Web.Security;
using Teknik.Helpers;
using Teknik.Models;

namespace Teknik.ViewModels
namespace Teknik.Areas.Profile.ViewModels
{
public class LoginViewModel
{

Teknik/ViewModels/RegisterViewModel.cs → Teknik/Areas/Profile/ViewModels/RegisterViewModel.cs 查看文件

@@ -1,9 +1,10 @@
using System;
using System.ComponentModel.DataAnnotations;
using Teknik.Areas.Profile.Models;
using Teknik.Helpers;
using Teknik.Models;

namespace Teknik.ViewModels
namespace Teknik.Areas.Profile.ViewModels
{
public class RegisterViewModel
{

+ 1
- 0
Teknik/Areas/Profile/Views/Profile/Index.cshtml 查看文件

@@ -0,0 +1 @@
@using Teknik.Models

Teknik/Views/Profile/Login.cshtml → Teknik/Areas/Profile/Views/Profile/Login.cshtml 查看文件

@@ -1,6 +1,6 @@
@model Teknik.ViewModels.LoginViewModel
@model Teknik.Areas.Profile.ViewModels.LoginViewModel

<form role="form" id="loginForm" action="@Url.Action("Login", "Profile", new { area = "Home" })" method="post" accept-charset="UTF-8">
<form role="form" id="loginForm" action="@Url.Action("Login", "Profile", new { area = "Profile" })" method="post" accept-charset="UTF-8">
@Html.ValidationSummary(true, "Login failed. Check your login details.")
<div class="form-group">
<input type="text" class="form-control" id="Username" value="" placeholder="Username" name="Username" data-val-required="The Username field is required." data-val="true" />

Teknik/Views/Profile/Register.cshtml → Teknik/Areas/Profile/Views/Profile/Register.cshtml 查看文件

@@ -1,4 +1,4 @@
@model Teknik.ViewModels.RegisterViewModel
@model Teknik.Areas.Profile.ViewModels.RegisterViewModel

<form role="form" id="registrationForm" action="@Url.Action("Register", "Profile", new { area = "Profile" })" method="post" accept-charset="UTF-8">
@Html.ValidationSummary(true, "Registration failed. Check your registration details.")

+ 3
- 0
Teknik/Areas/Profile/Views/_ViewStart.cshtml 查看文件

@@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}

+ 36
- 0
Teknik/Areas/Profile/Views/web.config 查看文件

@@ -0,0 +1,36 @@
<?xml version="1.0"?>

<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.Optimization" />
<add namespace="Teknik" />
</namespaces>
</pages>
</system.web.webPages.razor>

<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>

<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>

+ 0
- 193
Teknik/Controllers/ProfileController.cs 查看文件

@@ -1,193 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using SecurityDriven.Inferno.Hash;
using SecurityDriven.Inferno.Mac;
using Teknik.Models;
using Teknik.ViewModels;
using SHA384 = Teknik.Helpers.SHA384;

namespace Teknik.Controllers
{
public class ProfileController : DefaultController
{
private TeknikEntities db = new TeknikEntities();

[AllowAnonymous]
// GET: Profile
public ActionResult Index()
{
return View();
}

[HttpGet]
[AllowAnonymous]
// GET: Profile
public ActionResult Login()
{
return View();
}

[HttpPost]
[AllowAnonymous]
public ActionResult Login(LoginViewModel model)
{
if (ModelState.IsValid)
{
if (model.IsValid())
{
FormsAuthentication.SetAuthCookie(model.Username, model.RememberMe);
return Json(new {result = "true"});
}
}
return Json(new { error = "Invalid User name or Password." });
}
public ActionResult Logout()
{
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
}

[HttpPost]
[AllowAnonymous]
public ActionResult Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
var foundUser = db.Users.Where(b => b.Username == model.Username);
if (foundUser.Any())
{
return Json(new {error = "That username already exists."});
}
if (model.Password != model.ConfirmPassword)
{
return Json(new {error = "Passwords must match."});
}
if (model.Insert())
{
return RedirectToAction("Login", "Profile", new LoginViewModel { Username = model.Username, Password = model.Password });
}
return Json(new { error = "You must include all fields." });
}
return Json(new { error = "You must include all fields." });
}

// GET: Profile/Details/5
public ActionResult Details(int? id)
{
if (ModelState.IsValid)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
User user = db.Users.Find(id);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}
return HttpNotFound();
}

// GET: Profile/Create
public ActionResult Create()
{
return View();
}

// POST: Profile/Create
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "UserId,Username")] User user)
{
if (ModelState.IsValid)
{
db.Users.Add(user);
db.SaveChanges();
return RedirectToAction("Index");
}

return View(user);
}

// GET: Profile/Edit/5
public ActionResult Edit(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
User user = db.Users.Find(id);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}

// POST: Profile/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "UserId,Username")] User user)
{
if (ModelState.IsValid)
{
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(user);
}

// GET: Profile/Delete/5
public ActionResult Delete(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
User user = db.Users.Find(id);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}

// POST: Profile/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int id)
{
User user = db.Users.Find(id);
db.Users.Remove(user);
db.SaveChanges();
return RedirectToAction("Index");
}

protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}
}

+ 4
- 0
Teknik/Global.asax.cs 查看文件

@@ -8,6 +8,8 @@ using System.Web.Routing;
using Teknik.Models;
using System.Data.Entity;
using System.Web.Security;
using Teknik.Migrations;
using System.Data.Entity.Migrations;

namespace Teknik
{
@@ -15,6 +17,8 @@ namespace Teknik
{
protected void Application_Start()
{
Database.SetInitializer(new MigrateDatabaseToLatestVersion<TeknikEntities, Configuration>());

AreaRegistration.RegisterAllAreas();

FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

+ 32
- 0
Teknik/Migrations/Configuration.cs 查看文件

@@ -0,0 +1,32 @@
namespace Teknik.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;

internal sealed class Configuration : DbMigrationsConfiguration<Teknik.Models.TeknikEntities>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
}

protected override void Seed(Teknik.Models.TeknikEntities context)
{
// This method will be called after migrating to the latest version.

// You can use the DbSet<T>.AddOrUpdate() helper extension method
// to avoid creating duplicate seed data. E.g.
//
// context.People.AddOrUpdate(
// p => p.FullName,
// new Person { FullName = "Andrew Peters" },
// new Person { FullName = "Brice Lambson" },
// new Person { FullName = "Rowan Miller" }
// );
//
}
}
}

+ 9
- 1
Teknik/Models/TeknikEntities.cs 查看文件

@@ -1,17 +1,25 @@
using System.Data.Entity;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Teknik.Areas.Blog.Models;
using Teknik.Areas.Profile.Models;
using Teknik.Migrations;

namespace Teknik.Models
{
public class TeknikEntities : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Group> Groups { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<User>().ToTable("Users");
modelBuilder.Entity<Group>().ToTable("Groups");
modelBuilder.Entity<Role>().ToTable("Roles");
modelBuilder.Entity<Blog>().ToTable("Blogs");
modelBuilder.Entity<Post>().ToTable("Posts");


+ 20
- 10
Teknik/Teknik.csproj 查看文件

@@ -145,21 +145,29 @@
<Compile Include="Areas\Home\HomeAreaRegistration.cs" />
<Compile Include="Areas\Privacy\Controllers\PrivacyController.cs" />
<Compile Include="Areas\Privacy\PrivacyAreaRegistration.cs" />
<Compile Include="Areas\Profile\Controllers\ProfileController.cs" />
<Compile Include="Areas\Profile\Models\AuthUser.cs" />
<Compile Include="Areas\Profile\Models\UserIdentity.cs" />
<Compile Include="Areas\Profile\ProfileAreaRegistration.cs" />
<Compile Include="Configuration\Config.cs" />
<Compile Include="Areas\Blog\Controllers\BlogController.cs" />
<Compile Include="Controllers\DefaultController.cs" />
<Compile Include="Areas\Dev\Controllers\DevController.cs" />
<Compile Include="Controllers\ProfileController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Helpers\Crypto.cs" />
<Compile Include="Models\Post.cs" />
<Compile Include="Areas\Profile\Models\Group.cs" />
<Compile Include="Areas\Profile\Models\PermissionTarget.cs" />
<Compile Include="Areas\Profile\Models\PermissionType.cs" />
<Compile Include="Areas\Blog\Models\Post.cs" />
<Compile Include="Areas\Profile\Models\Role.cs" />
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\TeknikEntities.cs" />
<Compile Include="Models\User.cs" />
<Compile Include="Models\Blog.cs" />
<Compile Include="ViewModels\LoginViewModel.cs" />
<Compile Include="ViewModels\RegisterViewModel.cs" />
<Compile Include="Areas\Profile\Models\User.cs" />
<Compile Include="Areas\Blog\Models\Blog.cs" />
<Compile Include="Areas\Profile\ViewModels\LoginViewModel.cs" />
<Compile Include="Areas\Profile\ViewModels\RegisterViewModel.cs" />
<Compile Include="ViewModels\ViewModelBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="App_Start\SubdomainRoute.cs" />
@@ -214,6 +222,9 @@
<Content Include="Areas\Contact\Views\web.config" />
<Content Include="Areas\Contact\Views\_ViewStart.cshtml" />
<Content Include="Areas\Contact\Views\Contact\Index.cshtml" />
<Content Include="Areas\Profile\Views\web.config" />
<Content Include="Areas\Profile\Views\_ViewStart.cshtml" />
<Content Include="Areas\Profile\Views\Profile\Index.cshtml" />
<None Include="Properties\PublishProfiles\Teknik Dev.pubxml" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
<Content Include="Scripts\common.js" />
@@ -250,15 +261,13 @@
<Content Include="Views\Shared\_LoginPartial.cshtml" />
<Content Include="Views\Shared\_Navbar.cshtml" />
<Content Include="Views\Shared\_Footer.cshtml" />
<Content Include="Views\Profile\Index.cshtml" />
<Content Include="Views\Profile\Login.cshtml" />
<Content Include="Views\Profile\Register.cshtml" />
<Content Include="Areas\Profile\Views\Profile\Login.cshtml" />
<Content Include="Areas\Profile\Views\Profile\Register.cshtml" />
<Content Include="Areas\Dev\Views\Dev\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\About\Models\" />
<Folder Include="Areas\About\Views\Shared\" />
<Folder Include="Areas\Blog\Models\" />
<Folder Include="Areas\Blog\Views\Shared\" />
<Folder Include="Areas\Contact\Models\" />
<Folder Include="Areas\Contact\Views\Shared\" />
@@ -268,6 +277,7 @@
<Folder Include="Areas\Home\Views\Shared\" />
<Folder Include="Areas\Privacy\Models\" />
<Folder Include="Areas\Privacy\Views\Shared\" />
<Folder Include="Areas\Profile\Views\Shared\" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />

+ 0
- 1
Teknik/Views/Profile/Index.cshtml 查看文件

@@ -1 +0,0 @@


+ 1
- 1
Teknik/Views/Shared/_Layout.cshtml 查看文件

@@ -8,7 +8,7 @@
<meta name="author" content="@ViewBag.Config.Author" />
<title>@ViewBag.Title</title>
<link rel="shortcut icon" href="/Content/Images/favicon.ico" type="image/x-icon" />
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/CSS/Common")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/markdown")

+ 4
- 4
Teknik/Views/Shared/_LoginPartial.cshtml 查看文件

@@ -12,14 +12,14 @@
<li>
<a href="@Url.Action("Index", "Blog", new { area = "Blog" })/@User.Identity.Name">Blog</a>
</li>
if (User.Identity.Group == Groups.Founder)
@if (User.IsInRole("Admin"))
{
<li>
<a href="@Url.Action("Index", "Admin", new { area = "Admin" })">Administration</a>
</li>
}
<li>
@Html.ActionLink("Sign Out", "Logout", "Profile", new { area = "Profile" })
@Html.ActionLink("Sign Out", "Logout", "Profile", new { area = "Profile" }, null)
</li>
</ul>
</li>
@@ -29,14 +29,14 @@ else
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="reg_dropdown">Sign Up <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
@Html.Partial("../Profile/Register", new Teknik.ViewModels.RegisterViewModel())
@Html.Partial("../../Areas/Profile/Views/Profile/Register", new Teknik.Areas.Profile.ViewModels.RegisterViewModel())
</div>
</li>

<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="login_dropdown">Sign In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
@Html.Partial("../Profile/Login", new Teknik.ViewModels.LoginViewModel())
@Html.Partial("../../Areas/Profile/Views/Profile/Login", new Teknik.Areas.Profile.ViewModels.LoginViewModel())
</div>
</li>
}

正在加载...
取消
保存