I can use Html.Action if you calling it in template ... but I need to call it using a macro so i don't need to create lot of templates to each form.
but I can see that if i call it using partial that not hit index method in controller, in partial macro I cannot call Html.Action .
In one testing i had infinite loop and execute submit method
partial view render from macro partial view not reach index method of controller
Hi all,
I am creating a partial view and need to redirect login page if member not logged in. I have call response.redirect("/login/?mymsg=1") from View
Then in Login Controller Index Method I was trying to get request query string mymsg and set a TempData value to display on Login view.
but I have noticed that my first view redirect to Login page but not setting up msg why Login Controller not execute Index Method ?
public class icLoginController : SurfaceController { // GET: icLogin [HttpGet] public ActionResult Index() { TempData["displaymsg1"] = "TEST passmsg";
string stmsg = setmsg(); if (!String.IsNullOrEmpty(stmsg)) { TempData["displaymsg"] = setmsg(); }
I have tried call renderPartial from first view and then pass viewdata so I can read it from Index
any help would be great
Hi Pat,
@Html.RenderPartial does not use a controller.
I'm gussing you are looking for @Html.Action("Index","icLogin")
Dave
I can use Html.Action if you calling it in template ... but I need to call it using a macro so i don't need to create lot of templates to each form.
but I can see that if i call it using partial that not hit index method in controller, in partial macro I cannot call Html.Action . In one testing i had infinite loop and execute submit method
any idea how to sort this?
is working on a reply...