TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
465.5k
How to make your create work in your MVC web?
Jan 23 2020 3:14 PM
Hi Mate
I have login.cshtml page and it has login button(this works), but my create button does not(how do i make an implementation for this to allow users be created)? I have this flow below from my Views/Account/login.cshmtl;
<div data-=
"mainContent"
>
<section
class
=
"container"
>
<div
class
=
"logo col-sm-12 text-center col-md-12"
> <img alt=
""
src=
"~/Images/eNtsa.png"
/></div>
<div
class
=
"clearfix"
></div>
<div
class
=
"container"
>
<div
class
=
"row"
>
<div id=
"MyWizard"
class
=
"formArea LRmargin"
>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div id=
"divMessage"
class
=
"text-center col-md-12 col-md-offset-12 alert-success"
>
@Html.ValidationSummary()
</div>
<div
class
=
"glyphicon-log-out col-sm-12 text-center col-md-12"
> <img alt=
""
src=
"~/Images/gcobani.jpg"
/></div>
<div
class
=
"clearfix"
></div>
<div
class
=
"col-md-12 col-md-offset-10 col-xs-12"
>
<div
class
=
"loginPage panel-info"
>
<span
class
=
""
><i
class
=
"glyphicon glyphicon-user"
>Username</i></span>
<div
class
=
"form-group text-center"
>
@Html.TextBoxFor(model => model.username,
new
{ @
class
=
"form-control text-center"
, autocomplete =
"off"
})
@Html.ValidationMessageFor(model => model.username)
</div>
<div
class
=
"form-group"
>
<span
class
=
""
><i
class
=
"glyphicon glyphicon-user"
>Password</i></span>
@Html.PasswordFor(model => model.password,
new
{ @
class
=
"form-control text-center"
, autocomplete =
"off"
})
@Html.ValidationMessageFor(model => model.password)
</div>
</div>
<div
class
=
"form-group"
>
<input id=
"BtnLogin"
type=
"submit"
class
=
"btn btn-success btn-pressure"
name=
"BtnLogin"
value=
"Login"
/>
<input id=
"BtnReset"
type=
"reset"
value=
"Create"
class
=
"btn btn-info btn-pressure"
name=
"BtnReset"
value=
"Reset"
/>
</div>
</div>
}
<div
class
=
"clear"
></div>
</div>
</div>
</div>
My Question do i have to create this first on my Routing.cs under AppStart folder, i notice my login is routing there? Also have i created a method create on my Controller. See this below
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
System.Web.Routing;
namespace
eNtsaPortalWebsiteProject
{
public
class
RouteConfig
{
public
static
void
RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute(
"{resource}.axd/{*pathInfo}"
);
routes.MapRoute(
name:
"Default"
,
url:
"{controller}/{action}/{id}"
,
defaults:
new
{ controller =
"Account"
, action =
"Login"
, id = UrlParameter.Optional }
);
}
}
}
Reply
Answers (
1
)
WART is not generating password
sql query vs special characters omit