I have a problem while trying to render a partial action on my layout. On the line :
@{Html.RenderAction("Login");}
i get an error "CS1501: No overload for method 'Write' takes 0 arguments". I have tried also invoking the RenderPartial directly, with the same result... Can you tell me what is wrong?
The code of my partial view:
@model SikWebRole.Models.LogOnModel
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.LoginLink').click(function () {
$('#loginForm').submit();
});
});
</script>
@using (Html.BeginForm("LogOn", "Account", FormMethod.Post, new { id = "loginForm" }))
{
<div class="loginBox">
<div class="errorMsg">
@Html.ValidationSummary(true, "Błędny login/hasło.")
</div>
<div class="loginHolder">
<input type="text" class="textInput" name="UserName" value="Login" />
</div>
<div class="passwordHolder">
<input type="text" class="textInput" name="Password" value="Hasło" />
</div>
<input name="RememberMe" style="display:none;" type="hidden" value="true"/>
<a href="#" class="loginLink" ><span class="loginButton">Zaloguj</span></a>
<ul><a href="#"><li class="registerLi">Zarejestruj</li></a><a href="#"><li class="RemindLi">Przypomnij hasło</li></a></ul>
</div>
}
The function used for render action:
public PartialViewResult Login()
{
return PartialView("LogOnForm", new SikWebRole.Models.LogOnModel());
}
The partial view I want to render belongs to the "LogOn" method which is from the Account Controller, and the Login method is in the Picture Controller, maybe this is the reason?
I would be glad for all the answers.
Best Regards
As requested this is the code of my Layout.cshtml: http://pastebin.com/He2Rp5P4