The solution to this was simple, actually. It seems that some of my control where interfering with the Request
object. After testing with an empty project to see that the problem was indeed on my side, I created a new master page.
By default, the form is wrapped around the ContentPlaceholder
so I set the its attributes as instructed by Braintree's documentation, copied the javascript call and declarations below that, and in my default.aspx
, the HTML is as follows:
<p>
<label>Card Number</label>
<input type="text" size="20" autocomplete="off" data-encrypted-name="number" />
</p>
<p>
<label>CVV</label>
<input type="text" size="4" autocomplete="off" data-encrypted-name="cvv" />
</p>
<p>
<label>Expiration (MM/YYYY)</label>
<input type="text" size="2" data-encrypted-name="month" /> / <input type="text" size="4" data-encrypted-name="year" />
</p>
<input type="submit" id="submit" onserverclick="SubmitButton_Click" runat="server"/>
Notice the runat="server"
and onserverclick
attributes on the input
. I haven't actually tested this if it will work with normal asp control.
That works now, so I am moving to the tough part :)
EDIT: This works with asp controls also!