Format:
Recent snippets matching tags of ASP.NET MVC
using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Web.Mvc; using Microsoft.Practices.EnterpriseLibrary.Validation; namespace Thoughtology.Web.Mvc { /// <summary> /// Maps a browser request to a data object and provides validation
291 Views
no comments
public ActionResult Index() { string modelDefinition = @"public class ChangePasswordModel { [Required] [DataType(DataType.Password)] [Display(Name = ""Current password"")] public string OldPassword { get; set; }
338 Views
no comments
Sub ToggleMvcBuildViews() DTE.ExecuteCommand("Project.UnloadProject") DTE.ExecuteCommand("OtherContextMenus.StubProject.EditProjectFile") Dim wasSetToTrue As Boolean = SetMvcBuildView(True) Dim wasSetToFalse As Boolean If Not wasSetToTrue Then wasSetToFalse = SetMvcBuildView(False) End If
768 Views
no comments
Imports System Imports System.Linq Imports System.Net.Mail Imports System.Web.Mvc Imports System.Web.Security Imports MvcMembership <Authorize(Roles:="Administrador")> _
1153 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Mvc.Ajax; using System.Web.Routing; namespace CodePasteMvc.Controllers {
359 Views
no comments
public class ErrorController : baseController { /// <summary> /// Displays a generic error message /// </summary> /// <param name="title"></param> /// <param name="message"></param> /// <param name="redirectTo"></param> /// <returns></returns>
343 Views
no comments
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{resource}.aspx/{*pathInfo}"); routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); routes.MapRoute("New", "New/{*pathinfo}", new { controller = "Snippet", action = "New" } );
202 Views
no comments
/// <summary> /// Displays a self contained error page without redirecting. /// </summary> protected ActionResult DisplayErrorPage(string title, string message, string redirectTo) { ErrorController controller = new ErrorController(); controller.InitializeForced(this.ControllerContext.RequestContext); return controller.ShowError(title,message, redirectTo); }
75 Views
no comments
// To call the view directly: public ActionResult ErrorTest() { return this.View("ShowError", new ErrorViewModel { Title = "From Show Controller", Message = "To Error Controller" }); }
93 Views
no comments
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{resource}.aspx/{*pathInfo}"); routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); routes.MapRoute("New", "New/{*pathinfo}", new { controller = "Snippet", action = "New" }
454 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
