views:

91

answers:

1
  1. I built a form in sales force and added it to my site. The whole goal of this is that the form on my site submits to sales force.
  2. I want to add server-side validation to my form like I have on other forms on my site.
  3. Sales force uses a weird name for drop down lists that often starts with a number. In my case, the drop down list input name="33N80563003V2aX"

This is giving me an issue because, as I understand it, the name of the property in my model has to match the name of the input control on the .aspx page. However, I can't have the name of my property start with a number.

//In my .aspx page: 
Name: 
<%= Html.TextBox("name", Model.Name, new { tabindex = 1 })%>

Type of Issue: 
<%= Html.DropDownList("33N80563003V2aX", Model.33N80563003V2aX, "--None--", new { tabindex = 2 })%>

//In my model: (does not compile because of the name)
public string Name { get; set; }
public SelectList 33N80563003V2aX { get; set; }

Any suggestions?

+2  A: 

We built a similar solution interfacing .NET and Salesforce.com. There are two ways to implement - one is to post directly to Salesforce.com, and the other is to proxy the request, like you are doing, so you can do validation and other stuff. Since you are proxying the request, your form doesn't have to match Salesforce.com requirements at all.

You should collect all the data, then use the .NET HTTP objects assemble a post to Salesforce.com with whatever param names they require. You can then call your dropdown "glurm" or whatever you want, as you'll be repackaging the data for sending to Salesforce.com

Joshua
Ahh that makes a lot more sense than what I ended up doing (ugly workaround) thanks!!
Buchannon