I have functions in my view that is shared by several pages:
@functions
{
public HtmlString ModeImage(ModeEnum mode)
{
switch(mode)
{
This sounds like you want the Razor @helper methods described in the blog post ASP.NET MVC3 and the @helper syntax within Razor by Scott Guthrie.
Here is the overview... "The @helper syntax within Razor enables you to easily create re-usable helper methods that can encapsulate output functionality within your view templates. They enable better code reuse, and can also facilitate more readable code."