CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of mvc3
C#
@using Adnug.web.AssetManager;
 
@Html.TextBox(string.Empty, /* Name suffix */
    ViewData.TemplateInfo.FormattedModelValue /* Initial value */
)
@this.BeginClientScript()
<script type="text/javascript">
    (function () {
        $("#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)").datetimepicker();
    })();
by erichexter   September 11, 2011 @ 9:52pm
Tags: MVC3
161 Views
1 comments
 
<!--In Layout - Note that the Render call is made at the end of the body.-->
<!DOCTYPE html>
<html>
    <head>
        <title>@Model.PageTitle</title>
        @Scripts.Add("jquery-1.6.min.js", 100)
    </head>
    <body>
        @Html.Partial("ToolbarView", Model)
        @RenderBody()
by Rob Eisenberg   August 25, 2011 @ 10:05am
Tags: MVC, MVC3, Script
286 Views
no comments
 
C#
public static class Scripts {
    const string ScriptsKey = "Scripts";
 
    public static MvcHtmlString Add(string src, int priority = 0) {
        var scripts = GetScripts();
 
        scripts.Add(new Script {
            Src = src,
            Priority = priority
        });
by Rob Eisenberg   August 25, 2011 @ 10:01am
Tags: MVC, MVC3, Script
363 Views
3 comments
 
C#
public class UnityControllerActivator : IControllerActivator
    {
 
        private IUnityContainer _container;
 
        public UnityControllerActivator(IUnityContainer container)
        {
            _container = container;
        }
by rjygraham   December 12, 2010 @ 6:21pm
Tags: MVC3, Unity
227 Views
no comments
 
C#
protected void RegisterDependencyInjection()
        {
            _container = new UnityContainer();
            _container.RegisterType<IControllerActivator, UnityControllerActivator>();
 
            _container.RegisterType<ISimpleService, DefaultSimpleService>();
            
            DependencyResolver.SetResolver(new UnityDependencyResolver(_container));
        }
by rjygraham   December 12, 2010 @ 6:20pm
Tags: MVC3, Unity
174 Views
no comments
 
C#
public class UnityDependencyResolver : IDependencyResolver
{
 
        private IUnityContainer _container;
 
        public UnityDependencyResolver(IUnityContainer container)
        {
            _container = container;
        }
by rjygraham   December 12, 2010 @ 6:13pm
Tags: MVC3, Unity
595 Views
no comments
 
C#
// This does NOT work, but I believe it should. Fix below
 
@if (!ChatPast.Web.Core.SiteMembership.HasActiveSession) {
                @{Html.RenderPartial("AnonymousAccountInfo" ); }
            } else {
                @{Html.RenderPartial( "RegisteredAccountInfo" ); }
            }
 
 
// This does work, but why not above?
by Michael Kennedy   November 11, 2010 @ 10:41pm
Tags: mvc3
1176 Views
3 comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate