Ram
Ram

Reputation: 337

recaptcha in mvc 4, post method is not hitting when submit the page

My recaptcha post action method is not hitting when i submit the page. It showing in fiddler that it is going to post method. but not hitting in my VS2010. previously it was worked when i use the mysql data base not used entity framework. now we are using sql2012 and entity framework. is any references are missing. or input parameters are not accessing properly in post method. i am not getting any point. can any one help. How can i fix this.

view:

<div class="left-div-user">
            <div class="t-32_b_user">
                Forgot password?</div>
            <div class="t-12-user">
                Email
            </div>
            <div>
                @Html.TextBoxFor(model => model.Email, new { @class = "user-input-bx" })</div>
            <div style="font: 20px; color: Black; font-weight: bold;">
                Please enter the below words in the box.
            </div>
            <div class="t-12_2-user">
                @Html.ValidationMessageFor(model => model.Email)</div>
            <div>
                @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
                @Html.ValidationMessage("captcha")
            </div>
            <input name="" type="submit" class="user-common-btn1" value="Submit" />
        </div>  

ActionMethod:

[HttpPost]
        [AllowAnonymous]
        [RecaptchaControlMvc.CaptchaValidator]
        public ActionResult ForgotPassword(ForgotPasswordModel fp, bool CaptchaValid, String CaptchaErrorMessage)
        {
            //my code
         }

web.config:

    <appSettings>
    <add key="ReCaptchaPrivateKey" value="privatevalue" />
    <add key="ReCaptchaPublicKey" value="publicvalue" />
    </appSettings>

    <system.web>
    <namespaces>
    <add namespace="Recaptcha" />
    </namespaces>
    </system.web>

Upvotes: 1

Views: 311

Answers (0)

Related Questions