I have form tag in an ASPX page,
<form id="payForm" method="post" action="<%Response.Write(URL);%>" runat="server">
</form>
On the pageload event,
Literal mylit = new Literal();
mylit.Text = string.Format("<input type=\"hidden\" name=\"{0}\" value=\"{1}\" /> \n", name, value);
payForm.Controls.Add(mylit);
How do I make my form to submit after adding this control defined in pageload event?
If I write this code
<script language="javascript" type="text/javascript">
document.forms["payForm"].submit();
</script>
then this snipet of code also cannot find the payForm
object.