MVC Views And HTML Helpers

MVC Views And HTML Helpers - CSS Helper Functions This...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Managing MVC Views with HTML Helper Functions in VB.Net Application Development II IS 3920
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
HTML Helper Functions There are many HTML Helper Functions that you can use in your Views to format HTML and also to help you pass values back to your Controller functions. (Note that all the functions require using the <% and %> inline code tags.
Background image of page 2
This Helper function provides a link to the standard CSS file: Html.Css("~/Content/styles.css") CSS Helper Functions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This Helper function creates an Image tag with its Alt attribute: Html.Image("~/folder/img.gif", "My Alt Text") CSS Helper Functions
Background image of page 4
This function is used to create a Form for submitting fields: Html.BeginForm() CSS Helper Functions
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
These functions create submit buttons that either have a standard look (the first) or a special image (the second): Html.SubmitButton("submit", "Save") Html.SubmitImage ("submit","~/folder/img.gif ") CSS Helper Functions
Background image of page 6
This function is used to create a single line Text box: Html.TextBox("TextboxName")
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSS Helper Functions This function is used to create a single line Text box: Html.TextBox(&quot;FieldName&quot;) CSS Helper Functions This function is used to create a multi line Text box: Html.TextArea(&quot;FieldName&quot;) CSS Helper Functions This function is used to create a checkbox: Html.CheckBox(&quot;FieldName&quot;) CSS Helper Functions This function is used to create a radio button: Html.RadioButton(&quot;FieldName&quot;) CSS Helper Functions This function is used to create (action) links on a page. The following formats an link with the text Click here and sends it to the Brochure view of the Home controller: &lt;%= Html.ActionLink(&quot;Click here&quot;,&quot;Brochure&quot;,&quot;Home&quot;)%&gt; CSS Helper Functions You can use the Action Link to send arguments to the Controller function. The following sends the ID argument with a value to the Brochure function: &lt;%= Html.ActionLink(&quot;Click here&quot;,&quot;Brochure&quot;,&quot;Home, New With {.ID = Value}, Nothing)%&gt; CSS Helper Functions...
View Full Document

Page1 / 13

MVC Views And HTML Helpers - CSS Helper Functions This...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online