PDA

View Full Version : Can't get form variables on server side



TheDude55
11 Jan 2011, 3:45 AM
Hi. I'm using asp.net as my back-end. When I submit a form using the FormPanel, HttpContext.Current.Request.Form is empty on the server side - I need the 'email' form variable. How do I get access to these variables (if I use standardSubmit:true, the variables are available).



var settings_form = new Ext.FormPanel({
//standardSubmit:true,
title: 'Fields',
labelWidth: 75, // label settings here cascade unless overridden
url: 'WebFormTest.aspx',
//frame: true,
bodyStyle: 'padding:5px 5px 0',
width: 700,
renderTo: document.body,
layout: 'column', // arrange items in columns
defaults: { // defaults applied to items
layout: 'form',
border: false,
bodyStyle: 'padding:4px'
},
items: [
new Ext.form.FieldSet({
title: 'Contact Information',
autoHeight: true,
defaultType: 'textfield',
items: [{
fieldLabel: 'Email',
name: 'email',
vtype:'email',
width:190
}]

,

buttons: [{
text: 'Save',
handler: function(){
settings_form.getForm().submit({
success: function(form, action){
Ext.Msg.alert('Success', 'It worked');
}, ......

Diddy433
26 Jan 2011, 7:32 PM
Are you using VB or C#? Anyways, I use C# and this is how I get variables submitted via form.




namespace SomeNamespace
{
public class SubmitFeedback : IHttpHandler
{

public void ProcessRequest(HttpContext aContext)
{
try
{
string comment = aContext.Request.Params["comment"];

...

TheDude55
26 Jan 2011, 9:52 PM
Thanks for that. I had subsequently found my problem and posted to that effect - but to another question I had asked which was related to this issue (my bad). I was using a header in an ajax request on that page that was causing the issue - here's the post http://www.sencha.com/forum/showthread.php?121739-Form-parameters-no-longer-available-after-adding-tree-nodes&p=563242 . Thanks anyway.