title: Creating a module for Orchard that stores data from the front-end
body: <p>Code will come later as soon as i am in front of my development machine, though hoping in the meantime someone can help....</p>
  
  <p>I am trying to develop on Orchard CMS v1.6.1. At the moment I am in the midst of trying to develop a module that will essentially allow me to place a Newsletter subscription view within the footer (or anywhere else i choose) on the front end.</p>
  
  <p>I have followed several tutorials and they all seem to show how to store data from the Admin only - I need to store data on the FRONT end as well as the admin... This is what I am looking for help on...</p>
  
  <p>So, so far, my module has all the "usual" driver/handler/editorTemplates view/migrations/contentpart/contentpartrecord and i can create a subscription entry in the admin - I have my content Type setup and see my module in the admin.</p>
  
  <p>Pick any tutorial on modules you like and that's the path i followed - they all seem to be the same in terms of creating a module and storing data via the admin....</p>
  
  <p>With answers from other questions I managed to get the module to display on the front-end - this is by way of overriding Display in my driver and using the shapeHelper.DisplayTemplate() method. </p>
  
  <p>Some strange things though - when the front-end (with my form now displayed thanks to Placement.info) page first loads I get a blank entry in my database table (subscriptions table) - this happens without actually posting back. I have little to no idea what part of code is causing this to happen. This needs to not happen - i only want to store data when the user fills out the form and clicks submit.</p>
  
  <p>Secondly, I need a little guidance in actually storing the data the user enters in on the front end.. </p>
  
  <p>Typically what should I have in my module to store data entered in the front end?</p>
  
  <p>I'm not after actual code - just an idea of what i should be doing. I develop in web forms typically, so MVC is a little new to me.</p>
  
  <p>should i have a controller/route etc? </p>
  
  <p>should the form i display on the front-end be somewhat separate from the module i have created?</p>
  
  <p>Can someone point me in the right direction of what you do to store data inside of Orchard? </p>
  
  <p>I guess at this point any help would be great...</p>
  
  <p><strong>Update</strong></p>
  
  <p>Thank you for the answers given so far. In this case I could use custom forms, though don't want to. I ideally want the data stored in it's own table.</p>
  
  <p>Also, this module will give me the basis i need to create more complex modules that will store data from the front-end. I just can't seem to get my head around how Orchard stitches this all together.. I.E storing data via the controller into the orchard system..what code would i need to create a new row in my table?</p>