I am trying to create a control to allow users to add themselves to our Constant Contact newsletter. I got code from them that contains a <form> so I decided to creaet a control to avoid that. Problem is that I am using SiteFinity...they do not support using PostBackUrl on a button in their content editors. Their response to fix the bug in their system, was to use Response.Redirect. Problem is that there are hidden fields in the control (shown below). I really dont want to have to dig into their API as this should work. How can I get it so that the control will submit to Constant Contact's site without using PostBackUrl on the button?? Here is what I have:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsletterSignup.ascx.cs"
Inherits="NewsletterSignup" %>
<h2>
Subscribe to Leadership Matters
</h2>
<p>
Submit your email to receive our monthly newsletter dedicated to career and recruiting
related topics.
</p>
<div style="text-align: left;">
<div style="width: 226px; height: 70px;">
<span style="background-color: #006699; margin-top: 2px; float: left; margin-left: 2px;
margin-right: 2px;">
<img alt="" style="border-bottom: 0px solid; border-left: 0px solid; border-top: 0px solid;
border-right: 0px solid;" src="http://img.constantcontact.com/ui/images1/visitor/email1_trans.gif" />
</span>
<input style="border-bottom: #999999 1px solid; border-left: #999999 1px solid; font-family: verdana,geneva,arial,helvetica,sans-serif;
border-top: #999999 1px solid; border-right: #999999 1px solid;" type="text"
name="ea" />
<asp:Button ID="Submit" runat="server" Style="font-family: verdana,arial,helvetica,sans-serif;
font-size: 10px;" Text="GO" OnClick="Submit_Click"></asp:Button><br />
<input value="1100358239499" type="hidden" name="m" />
<input value="oi" type="hidden" name="p" />
</div>
</div>Here is the code behind...simple:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class NewsletterSignup : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Submit_Click(object sender, EventArgs e)
{
Server.Transfer("http://visitor.constantcontact.com/d.jsp", true);
}
}