See if this helps at all - it's not exactly the same as what you are trying to do, but may help you get on the right track:
http://mathomps.blogspot.com.au/2011/04/implementing-search-bar-in-aspnet-mv c-3.html .when I was starting with MVC I was getting confused between Html.RenderAction and Html.Action and had all sorts of strange things happen. Regards, Mark. From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Tuesday, 2 April 2013 4:53 PM To: ozDotNet Subject: MVC Partialview help Hi People...i am fairly new to MVC and have a fundamental implementation issue. In asp.net webforms..i can have a usercontrol that has a submit button...when you click submit...you can change the data on that usercontrol and it will postback to the same page. All good. Eg a login usercontrol When you login(which ever page you're in), it will post back and change the user control to 'Welcome back Anthony' for example. How do i do this in MVC? See below for my code..basically it is returning to my logon partial view on submit instead of the main page. Main view........Home/Intro <div>The Cool Website<div/> @Html.RenderAction("Logon","Account"); <div id="divBackHome"> <img width="18px" height="18px" alt="" src="/images/home.jpg"> <a href="/Home/Index">Home</a> </div> Controller..... Function Logon() As ActionResult Return View(New LogonModel With {.ReturnUrl = Request.RawUrl}) End Function <HttpPost()> Function Logon(ByVal model As LogonModel) As ActionResult Dim iUserId As Int32 Dim msg As String = "" Dim sURL As String = model.ReturnUrl If ModelState.IsValid Then If Common.Functions.Login(model.Username.Trim, model.Password.Trim, msg, iUserId, BaseProperties.ResellerId, False) Then Return PartialView("Logon", model) Else model.Username = "test" ViewData("loginresult") = "login failed" Return PartialView("Logon", model) End If Else Return PartialView("Logon", model) End If End Function
