Postback not getting picked up

Jun 14, 2012 at 3:46 PM

Ive got it working apart from posting back properly!

All thats happening is i seem to be getting the GET method called. The post is firing and showing in fiddler but not being picked up by the controller. Any ideas why?

Ive stripped this down to a bare page with nothing but the form etc. so no rogue webforms forms hanging about and still no joy.

Action and method in the form tag seem fine. Any ideas what is wrong?



<form action="/newsletter" method="post">    <fieldset>

        <legend>Newsletter Sign Up Form</legend>

        <div class="editor-label">

            <label for="Name">Name</label>


        <div class="editor-field">

            <input class="text-box single-line" id="Name" name="Name" type="text" value="" />


        <div class="editor-label">

            <label for="Email">Email Address</label>


        <div class="editor-field">

            <input class="text-box single-line" id="Email" name="Email" type="text" value="" />


            <input type="submit" value="Submit" />





Jun 14, 2012 at 3:49 PM

And my controller is very simple to test this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Devotit.Umbraco.MvcBridge;

namespace UmbracoMVCPOC.Controllers
    public class NewsletterController : MvcBridgeController
        public PartialViewResult Index()
            return PartialView();
        public PartialViewResult Index(Models.Newsletter model)
            //if (!ModelState.IsValid)
            //    return PartialView(model);

            return PartialView("Success", model);

Jun 14, 2012 at 5:41 PM

Sussed it! I wasn't setting the token parameter - once i put something in this it worked.

Could someone explain what the token is for / how should it be used as its not in the demo etc...? 

Is it of a similar purpose to the [ValidateAntiForgeryToken] attribute?  If so I cant see how a plain text hidden input is going to protect against an XSS attack?

Jun 14, 2012 at 6:10 PM
Edited Jun 14, 2012 at 6:12 PM

Just read the support for parameters thread and looks like i was correct on my assumptions....  

Will have to go and re-test because but it didnt seem to want to output the token with the HTML helper so not sure why it wasn't working from the off!