I have this function to return a view

Function mostrar(cor As String, alinea As Char) As ActionResult
           ViewBag.cor = cor
           ViewBag.alinea = alinea
           Return View()
       End Function

this is the view

@Code
    ViewBag.Title = "mostrar"
    End Code

<h2>mostrar</h2>
<h4>@viewbag.cor</h4>
<h4>@ViewBag.alinea</h4>

the function is called from code but no view is returned. But i know the parameters enter the function.

if i put this in the URL:
http://localhost:16844/prescavi/mostrar?cor=red&alinea=s

The view works perfectly...

I guess, you want to request an action without adding parameters. Take a look at second parameter of action; it is non-nullable (value type). You need to convert Char type to Nullable.

Function mostrar(cor As String, alinea? As Char) As ActionResult
   ViewBag.cor = cor
   ViewBag.alinea = alinea
   Return View()
End Function
commented: Long tie no see - great to see you back! +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.