Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • tesuji 95 posts 139 karma points
    Sep 17, 2010 @ 01:35
    tesuji
    0

    No textboxes in user controls?

    I made a user control (.ascx/macro) to use in an Umbraco page. The user control has ASP.NET textboxes and submit button.

    When I open at the page in my brower, the rendering seems to choke when it gets to the first textbox. Within my Visual Studio project, the user control renders fine within a test.aspx page.

    Am I doing something wrong, or are textboxes not allowed for some reason in Umbraco user controls?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 17, 2010 @ 08:45
    Dirk De Grave
    0

    Pretty odd, you can basically do anything with a user control as you would in asp.net, so it shouldn't choke on that. Have you tried debugging the user control to check what's happening?

    Debugging is as easy as attaching to the w3wp.exe process in vs.net while browsing to the page of your umbraco website that contains the macro/user control

    Let us know what you find out.

    Cheers,

    /Dirk

  • Ferry Meidianto 36 posts 63 karma points
    Sep 18, 2010 @ 22:57
    Ferry Meidianto
    0

    Hi tesuji,

    ASP.NET TextBox should works fine in UserControl.

    In addition to Dirk's suggestion, please also try without any CSS or Javascript involved in the content/template. And also try running it in other browsers.

    Cheers,
    Ferry

  • tesuji 95 posts 139 karma points
    Sep 22, 2010 @ 16:51
    tesuji
    0

    To attach to the w3wp.exe process, I would need Umbraco running on my local machine, I assume? Right now it's just running at our shared web host.

    I'm not doing anything fancy with this - no CSS, Javascript, etc. Just a simple ASP.NET form. It's a weird problem.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 22, 2010 @ 16:56
    Tom Fulton
    0

    VS can do Remote Debugging but it requires some steps to setup, on your end and your host's.

    But as stated above it should work fine...can you paste your code?  Do you get any errors or is something just not displaying right?

  • tesuji 95 posts 139 karma points
    Sep 22, 2010 @ 17:18
    tesuji
    0

    I'm now troubleshooting using a simple test project with a button instead of a textbox.

    I don't have a lot of experience with .NET User controls but I've used a few in Umbraco in the past that just contained JavaScript and HTML.

    If you want I can put the code at an FTP location and you can download it. Let me know.

    Here is my code...

     

    test.ascx:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="test.ascx.cs" Inherits="ascxTest.test" %>

    <b>test3</b>

    <asp:Button ID="Button1" runat="server" Text="Button" />

    <b>testend</b>  

    [no code in the code-behind page]

     

    My test ASP.NET page in my VS project, with the user control - this test page works fine:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testpage.aspx.cs" Inherits="ascxTest.testpage" %>

    <%@ Register src="test.ascx" tagname="test" tagprefix="uc1" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

        <title></title>

    </head>

    <body>

        <form id="form1" runat="server">

        <div>    

            <uc1:test ID="test1" runat="server" />    

        </div>

        </form>

    </body>

    </html>

    [no code in the code-behind page]

     

    The rendered user control within my Umbraco page only shows the text test3. When I look at "view source" in the browser, there is no button, no second label text. It's like it stops rendering the control once it hits the button (ASP.NET textbox controls give the same problem.)

    My VS proejct is called ascxTest. When I upload to the Umbraco server, I put

    test.ascx /usercontrols and

    ascxTest.dll in /bin

     

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 22, 2010 @ 17:34
    Tom Fulton
    0

    Are you including the usercontrol via a Macro or directly in the template?

    Either way, maybe try enclosing in a form runat=server tag

    IE:

    <form runat="server">

    <umbraco:Macro .....>   (or <uc1:test ID="test1" runat="server" />    )

    </form>

  • tesuji 95 posts 139 karma points
    Sep 22, 2010 @ 19:00
    tesuji
    0

    That worked. I added the form runat=server tag to the user control.

    Much thanks.

Please Sign in or register to post replies

Write your reply to:

Draft