Okay i am developing some web application from the scratch. I have already made the custom login and registration pages using simple database from Tutorials Login and Registration. Now here's my site GUI or API, lets say there are two programs Program A and Program B. Anyone can visit my site's HOMEPAGE and use Program A but only authenticated user can use Program B by LOGIN() i.e. Program B link will be visible to those users who are LOGGED-IN.
So i need help to make my Program B secure, i.e. its links will be visible to those who are LOGGED-IN. I want to clear one more thing that Program A Link and "Program B Link" both are coded on main HomePage, so u can't direct access Program B by just URL. I hope you get what I am trying to say ... HELP!!! Below is my Login.cshtml code
@model FYPFinalTest3.Models.UserLogin
@{
Layout = null;
}
<h2>Login</h2>
@using (Html.BeginForm("Login","Login", FormMethod.Post))
{
//this is for create form tag
@Html.AntiForgeryToken() // this is for prevent CSRF attack
@Html.ValidationSummary(true)
if (@ViewBag.Message != null)
{
<div style="border:1px solid red">
@ViewBag.Message
</div>
}
<table>
<tr>
<td>@Html.LabelFor(a=>a.Username)</td>
<td>@Html.TextBoxFor(a=>a.Username)</td>
<td>@Html.ValidationMessageFor(a=>a.Username)</td>
</tr>
<tr>
<td>
@Html.LabelFor(a=>a.Password)
</td>
<td>
@Html.PasswordFor(a=>a.Password)
</td>
<td>
@Html.ValidationMessageFor(a=>a.Password)
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Login" />
</td>
<td></td>
</tr>
</table>
}
@* This below line is for create javascript section *@
@section Scripts{
@Scripts.Render("~/bundles/jqueryval")
}