HTML Helper

Extensions provided for the HtmlHelper class.


To use the extensions within your views the JL.Web.Forms.Html namespace must be added into the pages.namespaces section of your Web.config i.e.:
	<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.Linq"/>
	<add namespace="System.Collections.Generic"/>
	<add namespace="JL.Web.Forms.Html"/>


BeginMvcForm Method

This method works very similar to the default BeginForm method except the first parameter will always take a JL.Web.Forms.IForm object. The encoding type will automatically be set to the correct type for the supplied form.

Just like the default method wrapping the call in a using statement will output a closing tag for your form.

<% using (Html.BeginMvcForm(Model)) { %>
		<%=Model %>
			<td><input type="submit" value="Submit" /></td>
<% } %>

Last edited Jan 17, 2010 at 9:24 PM by timsavage, version 5


No comments yet.