|
|
Rank: Enthusiast
Joined: 9/16/2007 Posts: 29
|
Hi I'm trying to create my first Ascx usercontrol in Umbraco. But when I try to view the page I get the followig error: Control 'Test_1_btnSubmit' of type 'Button' must be placed inside a form tag with runat=server. My template looks like this: Code: <?ASPNET_FORM> <?UMBRACO_MACRO macroAlias="TestUserControl" ></?UMBRACO_MACRO> </?ASPNET_FORM>
I tried to minimize my ascx to isolate the problem, and I get the error even if it only looks like this: Code: <%@ Control Language="VB" ClassName="Test" %> <script runat="server"> Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'No code yet End Sub </script> <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="SubmitButton_Click" />
Any sugestions on how to get this to work? : Thomas
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
What does the rendered html page look like? // ; ) Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
Rank: Enthusiast
Joined: 9/16/2007 Posts: 29
|
The HTML? I get the yellow ASP.NET error, so I don't rendered HTML. But I get the error with the following Umbraco Template, if that is what you mean. Code: <html> <head> <title>test of user control</title> <head> <body> <?ASPNET_FORM> <?UMBRACO_MACRO macroAlias="TestUserControl" ></?UMBRACO_MACRO> </?ASPNET_FORM> </body> </html>
: Thomas
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
Of course you are... sorry for that stupid question :blush: Hmmm, your template looks right to me... Is this a fresh install or a site that has ran for some days? Sometimes strange things happens in fresh installs that takes an IIS restart to be solved, besides from that I just don't have a clue about what might be the error here... Could you provide the full error message? // ; ) Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
Rank: Aficionado
Joined: 7/23/2006 Posts: 172
|
Can you compile and run this in Visual studio.
Have you copied the dll to the bin folder.
Søren Linaa Level 1 & 2 Certified Professional
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
A thought: Is it possible that the user control must use separation with one interface file and one code-behind file to be able to work? I've never tried a user control with inline code myself therefore I can't verify that it will/should work like in the example you provided above... // ; ) Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
Rank: Enthusiast
Joined: 9/16/2007 Posts: 29
|
Hi Søren
Well... there is no dll. I only deployed the ascx file. All the code is inline.
Am I missing something?
Thanks for helping.
: Thomas
|
|
Rank: Enthusiast
Joined: 9/16/2007 Posts: 29
|
Hi Kalle
Inline vs. code behind should be the same. The ascx file I used is from a sample I found.
I'll try to move it in the code behind tonight.
: Thomas
|
|
 Rank: Fanatic
Joined: 7/22/2006 Posts: 255 Location: Randers, Denmark
|
Try adding ?umbDebugShowTrace=true to your URL, it should give you a more detailed error description
Best Regards Simon Simm.dk - My base on the web - proud Umbracian since 2.0 Beta
|
|
|
Guest |