ASP.NET Form problem

Edonkinho

New Member
I'm having problems calling another asp.net page to process my form request. In my form tag on form.aspx I'm doing the following: <BR><BR><form name="theForm" action="process.aspx" method="post"> <BR><asp:textbox id="fullname" runat="server" /><BR><asp:textbox id="email" runat="server" /><BR><input type="submit"><BR></form><BR><BR>instead of <BR><BR><form runat="server"> <BR><asp:textbox id="name" runat="server" /><BR><asp:textbox id="email" runat="server" /><BR><input type="submit"><BR></form><BR><BR>which does the same thing, except uses the current page to process the results. <BR><BR>I'm getting the following error message.. does any one know why? Any help is appreciated.<BR>=================<BR>Control 'FullName' of type 'TextBox' must be placed inside a form tag with runat=server. <BR>=================To programmatically set the contents of a Web control it needs to be in a server-side form. Why this insistence on directing the user to another page? Why not use the postback? You'll find that with ASP.NET to leverage the added functionality of the Web controls you need to use this postback functionality. If you must redirect to another page, you can always do so after processing. That is, you can do:<BR><BR><form runat="server"> <BR><asp:textbox id="name" runat="server" /><BR><asp:textbox id="email" runat="server" /><BR><asp:button text="Submit" runat="server" OnClick="btnSubmit_Click" /><BR></form><BR><BR><script language="vb" runat="server"><BR> Sub btnSubmit_Click(sender as Object, e as EventArgs)<BR> 'Do processing...<BR><BR> 'Redirect user<BR> Response.Redirect(url)<BR> End Sub<BR></script><BR><BR>hth<BR>It is an excellent idea that u suggested, but<BR><BR>why does'nt this work in ASP.NEt<BR><BR><form id="xyz" method="post" action="newxyz.aspx" runat=server><BR><BR>this should send the details of the form to newxyz.aspx?<BR><BR>not working?? why??<BR>
 
Back
Top