Skip to content

Container able to be added seemlessly into a webforms page that allows embedding of MVC views/controls in Web Forms Pages

Notifications You must be signed in to change notification settings

Jarga/WebForms-MvcContainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MVC Container for Web Forms

Container to allow Web Forms pages to act like MVC Controllers and call into Controllers via route names

Suggested Usage:

In Base Page:

	protected Lazy<MvcContainer> _mvc = new Lazy<MvcContainer>(() => new MvcContainer(new HttpContextWrapper(HttpContext.Current)));
	
	public MvcContainer Mvc
    {
        get { return _mvc.Value; }
    }
	
	public override void Dispose()
	{
		base.Dispose();

		if (_mvc.IsValueCreated)
		{
			_mvc.Value.Dispose();
		}
	}

In .aspx page:
	
	<div id="mainContents">
		<%=Mvc.Html.Action("#Action#", "#Controller#", new { Area = "#Area#" }) %>
	</div>

About

Container able to be added seemlessly into a webforms page that allows embedding of MVC views/controls in Web Forms Pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages