Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:57:49+00:00 2026-05-31T09:57:49+00:00

First thing, sorry for my English. I have two forms in index. Login form

  • 0

First thing, sorry for my English.

I have two forms in index.

Login form will post to localhost/Account/LogOn

Register form will post to localhost/Account/SignUp

How can I display error in localhost/ after user post one of the form ?

Currently the error will display in localhost/Account/LogOn or localhost/Account/SignUp

These are my codes:

#Index Action in HomeController

    Public Function Index() As ActionResult
        Return PartialView("_default")
    End Function

#_default layout
    <html>
        <head></head>
        <body>
            @code
                Html.RenderAction("SignUp", "Account")
            End Code

            @code
                 Html.RenderAction("LogOn", "Account")
            End Code
        </body>
    </html>

#SignUp Action in AccountController

Public Function SignUp() As ActionResult
    Return PartialView()
End Function

<HttpPost()> _
Public Function SignUp(user As UserView) As ActionResult
    If ModelState.IsValid Then
         'some process
         Return RedirectToAction("Welcome", "Home")
    Else
         ModelState.AddModelError("", "Email already taken")
    End If

    Return PartialView(user)
End Function

Basically LogOn Action in AccountController same with SignUp Action

I think I’m stuck with the Return PartialView(user)

I need to return to Index Action in HomeController and maintain the ModelState

Any hint to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:57:51+00:00Added an answer on May 31, 2026 at 9:57 am

    I think that usage of prg (POST-REDIRECT-GET) pattern is a good practice, and can help you in managing your problem. The modelState is imported and exported with filters.

    Look at the point no 13 here
    http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx#prg

    I think it’s always relevant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(First of all, sorry for my english, it's not my first language) I have
first of all sorry for my English :-) not so good. I have a
First of all, sorry for my English... I have something like this: public class
(Sorry for my english) First: I have an application created using C++ (this is
First, sorry for my bad English. I'm making a Coupons site and have trouble
I have some jQuery/JS below. The first thing to run is the alert box
Ok, first of all, sorry for my English. I'm working in a web project
Hey guys, first off all sorry, i can't login using my yahoo provider. anyways
First : Appologize for my bad english. Sorry for this newbie software question, but
First, I'm sorry for my english, it's not my native language. I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.