You need to sign in to do that
Don't have an account?
gringoese
Using web-to-lead with asp.net
I am converting a website to asp.net and running into problems with my Web-To-Lead forms. I need to use use the .NET server controls in my form so my text box code would be something like:
<asp:TextBox ID="first_name" runat="server" />
instead of:
<input name="first_name" type="text" />
The problem with this is that .NET renames the input fields. The resulting HTML comes out like this:
<input name="ctl00$content$first_name" type="text" id="ctl00_content_first_name" />
Salesforce won't accept this as it reuqires the field in this case must be named "first_name", not "ctl00$content$first_name".
Has anyone run into this and if so how did you get around it?
<asp:TextBox ID="first_name" runat="server" />
instead of:
<input name="first_name" type="text" />
The problem with this is that .NET renames the input fields. The resulting HTML comes out like this:
<input name="ctl00$content$first_name" type="text" id="ctl00_content_first_name" />
Salesforce won't accept this as it reuqires the field in this case must be named "first_name", not "ctl00$content$first_name".
Has anyone run into this and if so how did you get around it?
Use an Html control and mark it runat="server" instead of the asp:textbox
<input id="first_name" type="text" runat="server" ></input>
S
<input name="first_name" type="text" />
I didn't add runat="server" to the input tag because I couldn't think of anything to gain by using it.
To handle each field, in my code behind file I just use:
Request.Form["first_name"]
For validation I just use my own Javascript and C# (for client side/server side). I am not doing anything else that elaborate with my forms where I'll really miss the server controls. I would like to use the API and in the future I will probably go back and switch to that method.
By adding runat="server" you can access the control in code-behind as it is then running on the client side all properties are available as with any other server control
you should add an Id="first_name"
for example
firstname.Attributes.Add("onclick","doSomething");
public void doSomething(object sender, EventArgs e)
{
}
Regards S
http://mytechnicalcorner.blogspot.com/2008/04/sales-force-web-to-lead-form-custom.html