

The return type for a helper is always HelperResult, whereas the return type for a function is whatever you want it to be. In essence, a helper is a reusable snippet of Razor sytnax exposed as a method, and is intended for rendering HTML to the browser, whereas a function is static utility method that can be called from anywhere within your Web Pages application. They also share another thing in common - they look the same at first glance, which is what might cause a bit of confusion about their roles. As an example OrderedList(IEnumerable item in what is the difference? According to this previous post both and do share one thing in common - they make code reuse a possibility within Web Pages. However, this same work can be done through helper too. In the left Pane click Databases and then click on Add a database to your site. It's very simple to define a function inside razor. Step 1 Launch WebMatrix and Create a New Project 'Database Tutorial' with Empty site.
