asp.net mvc - What is the equivalent of OnCreatingUser in Mvc and how to use it -


itemprop = "text">

In my web form applications, I was checking my ASP.NET membership to control the event "OnCreatingUser" for my user's The name or email exits or if the user name is appropriate.

What is the equivalent method in MVC and how is it used?

Part of my method from the web form application.

  Public Zero cuwRegister_CreatingUser (Object Sender, LoginCancelEventArgs E) {Text Box Text Box = (TextBox) cuwRegister.CreateUserStep.ContentTemplateContainer.FindControl ("txtCaptchaTextBox"); If (text box. Text! = Session ["captcha image text"]. Tostring ()) {// Do not proceed should go back to Register.aspx and retry the visitor again. E.Cancel = true; } Text box txtUserName = (text box) cuwRegister.CreateUserStep.ContentTemplateContainer.FindControl ("user name"); If (ISUsNarom Obscen (TSTUSARNtext) || (! ISUserNameWalid (TTSTUsNarName Text.Rim ()) {Display Message ("Please Choose a Different User Name", "Alert"); E.Cancel = true;} (TxtUserName.Text.Length & lt; 4) {DisplayMessage ("Please select a username greater than 4 characters.", "Alert"); E.Cancel = true;}} Private zero performance message (string msg, string css) {// the message displayed in the label in the page}  

not me It seems that you can use ASP.NET 2.0 membership web server controls with ASP.NET MVC framework because they rely on the webforms postback model which is not supported by MVC.

You can use this functionality You can write your own controllers and ideas to provide. Alternatively, you may want to see it.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -