Search code examples
asp.nethtmlformshttp-post

Use asp.net button with a html form


I got a request to add this form to a asp.net control.

I want to use asp.net text box and button to submit the info to the form. (because I have special controls to match the look and feel).

this is the form:

<form name="ccoptin" id="signup" action="http://visitor.r20.constantcontact.com/d.jsp"
target="_blank" method="post">
<input type="hidden" name="llr" value="yyyyyy">
<input type="hidden" name="m" value="xxxxxx">
<input type="hidden" name="p" value="oi">
<label>sign up for new services and promotions:</label>
<input type="text"name="ea" value="" class="text" /> 
<input type="submit" id="iframe" class="submit"
 name="go" value="submit" />
 </form>

can this be done?


Solution

  • yes, you can use asp.net Textbox control for html input control and you can put the same styling. e.g.

     <asp:TextBox ID="ea" CssClass="text" runat="server"></asp:TextBox>
    

    Button control for html submit button e.g.

     <asp:Button ID="iframe" CssClass="submit" runat="server" Text="submit" />
    

    For your input type hidden, you can use asp.net HiddenField Control

    <asp:HiddenField ID="llr" runat="server" Value="yyyyyy" />