ورود

View Full Version : منوی خروج از صفحه ؟!؟!



kahkeshane2012
پنج شنبه 13 آذر 1393, 13:25 عصر
سلام.
دوستان من یک صفحه طراحی کردم که تصویر زیر گویای همه چی هست؛ طبق کدهای مربوطه میخوام قسمتی که زرد شده در صفحه نمایش داده نشود میشه بگید اشکال کارم کجاست :(


126285
این _LogoutPartial




@using System.Net.Mime
@using Microsoft.Ajax.Utilities
<link href="~/Content/css/MenuLogout.css" rel="stylesheet" />


@if (Request.IsAuthenticated)
{
using (Html.BeginForm("Logout", "Login", FormMethod.Post, new {id = "logoutForm"}))
{
@Html.AntiForgeryToken()
<ul class="nav navbar-nav navbar-right">
<li>
@Html.ActionLink("خوش آمدی " +"«"+ User.Identity.Name + "»", "Manage", "Login", routeValues: null, htmlAttributes: new {@class = "username", title = "Manage"})
</li>
<li>
<a id="logout" href="javascript:document.getElementById('logoutForm').s ubmit()" style="display: flex">خروج</a>
</li>
</ul>
}
}
else
{
<ul>
<li>@Html.ActionLink("Register", "Register", "Login", routeValues: null, htmlAttributes: new {id = "registerLink"})</li>
<li>@Html.ActionLink("Login", "Login", "Login", routeValues: null, htmlAttributes: new {id = "loginLink"})</li>
</ul>
<ul>
<li>@Html.ActionLink("Register", "Register", "Login", routeValues: null, htmlAttributes: new {id = "registerLink"})</li>
<li>@Html.ActionLink("Log in", "Login", "Login", routeValues: null, htmlAttributes: new {id = "loginLink"})</li>
</ul>
}


این صفحه Layout:



<body class="k-rtl">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@*@Html.ActionLink("Application name", "Index", "Home", null, new { @class = "navbar-brand" })*@
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("صفحه اصلی", "Index", "Home")</li>
<li>@Html.ActionLink("محصولات", "Contact", "Home")</li>
<li>@Html.ActionLink("اخبار", "Contact", "Home")</li>
<li>@Html.ActionLink("درباره ما", "About", "Home")</li>
<li>@Html.ActionLink("تماس با ما", "Contact", "Home")</li>
<li>@Html.Partial("_LogoutPartial")</li>
</ul>
</div>
</div>
</div>


@RenderBody()
</body>


البته وقتی میام خاصیت display رو none قرار میدم توی قسمت زیر اصلا قسمت خروج نمایش نمیده وقتی هم میزارم یه سطره دیگه که توی تصویر مشخص اضافه میکنه :(



<a id="logout" href="javascript:document.getElementById('logoutForm').s ubmit()" style="display: flex">خروج</a>

RIG000
پنج شنبه 13 آذر 1393, 13:32 عصر
این قسمتی که زرد شده به احتما ویویindex شماست که لایوت روشه. شما یه بار هم اونجا
@Html.Partial("_LogoutPartial") رو اجرا کردی... ببین تو ویو شما همچین چیزی هست برش دار.

kahkeshane2012
پنج شنبه 13 آذر 1393, 13:49 عصر
مرسی؛ درست شد :)
انگار منتظر بود این پستا ایجاد کنم فقط :)