|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
I'm just tryign to create a Contact Form User Control in .Net 2... and struggling. Here's the error i'm getting: Control 'ContactUs2_txtName' of type 'TextBox' must be placed inside a form tag with runat=server. You can see it here: http://payslip.com.au.tempdomain.info/contact.aspxI really don't understand what its getting at. What is a 'form tag' with runat=server? I've changed all <table>, <tr>, <td> cells to <asp:table>, <asp:tablerow>, <asp:tablecell>... etc... still no good. Any ideas? Thanks all greg
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 597 Location: Bad Homburg, Germany
|
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
I've tried adding <head runat="server"></head> to my default.aspx, but no change. See here: http://payslip.com.au.tempdomain.info/contact.aspxAny other ideas?
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
Oooh... I went through and made sure all the text boxes were initialised, rebuilt and reuploaded bin and ascx, and now getting this error message: Error creating control (/usercontrols/PPS_Contact/ContactUs.ascx). Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information! Its much neater as its appearing in a red box on the proper layout (so not being thrown by .Net itself)... seems Umbraco is handling the error now. Do i need to turn off caching for my ascx or something? Errr... nope. sorry. stacktrace was saying there was no definition for txtName_TextChanged - added that, rebuilt, reuploaded and back to original error again. ideas?? http://payslip.com.au.tempdomain.info/contact.aspx?umbdebugshowtrace=true
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 597 Location: Bad Homburg, Germany
|
The error message I get at your link is "Control 'ContactUs2_txtName' of type 'TextBox' must be placed inside a form tag with runat=server." Use Code:<?ASPNET_FORM></?ASPNET_FORM> in your template or add the form tag in your ascx. hth, Thomas
• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
ahhhhhhhhh..... that did the trick (putting <?ASPNET_FORM></?ASPNET_FORM> around the call to the macro)
Is this something i'll need to do only for web forms, or any ascx user controls? Don't remember seeing that one in the Docs anywhere.
thanks heaps :) Greg
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 597 Location: Bad Homburg, Germany
|
This is something that you have to do for all asp.net forms. Either you are putting this in the ascx itself (as Code:<form id="myForm" runat="server"></form> ) or in the template as mentioned before. In the second case Umbraco will create the form tag for you. Thomas
• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
Thomas Höhler wrote:...or in the template as mentioned before. In the second case Umbraco will create the form tag for you. Ummm, no it didn't. I added it into the template using the "Insert Macro" button, but it didnt add the form tags. Maybe cos its asp.net 2 user control??
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 597 Location: Bad Homburg, Germany
|
Greg wrote: I added it into the template using the "Insert Macro" button, but it didnt add the form tags. Maybe cos its asp.net 2 user control??
I think we are misunderstanding us. Each asp.net form needs a form tag with the runat=server attribute. VS puts this in for you if aou are putting an control which this tag needs via toolbox and drag and drop into your !aspx!. But it isn't doing this for ascx (as I remember). So therefore that you are putting an ascx into umbraco it is in your responsibility that this tag is present. So umbraco gives you the possibility to do this via . Or you are doing this in your ascx itself. But be aware that nested form tags brings problems (I think it doesn't work). Thomas
• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 507 Location: Melbourne, Australia
|
I'm with you now. I thought you said Umbraco automatically adds the Form tags when you insert an ascx macro... but what u meant was that it gives the option to add that if its not present in the ascx itself.
all good.. thanks again greg
Wishes he could work with Umbraco all the time.
|
|
|
Guest |