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
First Last
NA
648
73.2k
Viewbag content does not appear
Oct 6 2020 11:15 AM
I have an APS.Net web app Razor view where I attempt to display the Viewbag.errormessage.
The action method populates the viewbag but the view does not show the error message that is in the viewbag. It does not appear. Why?
Here is the view:
@Html.AntiForgeryToken()
<
div
class
=
"login-panel"
>
@if (ViewBag.errormessage != null)
{
<
p
class
=
"alert alert-danger"
id
=
"errorMessage"
>
@ViewBag.errormessage
p
>
}
<
div
class
=
"form-group"
>
<
div
class
=
"col-md-12 col-xs-12"
>
<
h2
>
Delete Account
h2
>
<
br
/>
<
h4
class
=
"verify"
>
<
strong
>
I will need to verify your identity in order to delete your account.
strong
>
h4
>
<
br
/>
<
h4
class
=
"verify"
>
<
strong
>
Please provide the following:
strong
>
h4
>
div
>
div
>
<
br
/>
<
div
class
=
"form-group"
>
<
div
class
=
"col-md-12 col-xs-12"
>
<
br
/>
<
label
class
=
"manadatory"
for
=
"UserName"
>
User Name
label
>
<
input
id
=
"UserName"
type
=
"text"
value
=
""
name
=
"UserName"
>
div
>
div
>
<
div
class
=
"form-group"
>
<
div
class
=
"col-md-12 col-xs-12"
>
<
br
/>
<
label
class
=
"manadatory"
for
=
"Password"
>
Password
label
>
<
input
id
=
"Password"
type
=
"text"
value
=
""
name
=
"Password"
>
div
>
div
>
<
div
class
=
"form-group"
>
<
div
class
=
"col-md-offset-0 col-md-10"
>
<
br
/>
<
input
class
=
"btn btn-primary deleteUserAccount"
value
=
"Delete Account"
>
@Html.ActionLink("Cancel", "Index", "User", null, new { @
class
=
"btn btn-info"
})
div
>
div
>
div
>
<
div
class
=
"modal fade"
id
=
"myModal4"
role
=
"dialog"
display
=
"none"
>
<
div
class
=
"modal-dialog"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-body"
style
=
"padding:10px;"
>
<
h4
class
=
"text-center"
>
Are you sure you want to permanently delete your account and all it contains? Continue ?
h4
>
<
div
class
=
"text-center"
>
<
a
class
=
"btn btn-info btn-yes4"
>
Yes
a
>
<
a
class
=
"btn btn-default btn-no4"
>
No
a
>
div
>
div
>
div
>
div
>
div
>
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Styles.Render("~/Content/css")
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
// code...
script
>
Reply
Answers (
5
)
integrating map in c# using API
Problem To create E-Cart By Cookies