locked
Missing asp:controls Help Please RRS feed

  • Question

  • I have 2 ascx pages with html tables in which i have included several textboxes, dropdown lists, etc. The problem is the asp:textbox, asp:dropdownlist, asp:button and similar tags do not render when the browser loads the page. The weird thing is that on one of the pages i am creating the table with asp:table, asp:tablerow, and asp:tablecell tags. This table renders fine, but the other tags do not render. here is an example from my code:

    <asp:TableRow CssClass="Table">
    
                <asp:TableCell CssClass="Cell">Where will you be?</asp:TableCell>
    
                <asp:TableCell CssClass="Cell">
    
                    <asp:DropDownList ID="LocationDD" runat="server" Width="200px">
    
                        <asp:ListItem value="0" selected="False">
    
                            Home
    
                        </asp:ListItem>
    
                        <asp:ListItem value="1" selected="False">
    
                            Gym
    
                        </asp:ListItem>
    
                    </asp:DropDownList>
    
                </asp:TableCell>
    
            </asp:TableRow>
    
    

    The code above renders the table no problem, but as soon as it gets to the asp:dropdownlist it renders the closing </td></tr> does not render the dropdownlist, and then stops.

     here is the html output from the website:

      <table id="Table1" border="0" style="width:400px;">
    
    	<tr class="Table">
    
    		<td class="Cell">Where will you be?</td><td class="Cell"><!-- the dropdown should be here -->
    
    </td>
    
        </tr><!-- more rows should appear here, but where did they go? -->
    
    
    
    

    Any help will be much appreciated. I am sure i am overlooking something simple, but for the life of me i can't find it. Thanks.
    If u died right now, where wud u b?
    • Edited by Rocky Giglio Friday, February 5, 2010 3:32 AM spelling mistake
    • Moved by Ji.Zhou Friday, February 5, 2010 5:42 AM ASP.NET issues (From:Visual C# General)
    Friday, February 5, 2010 3:31 AM

Answers

  • I figured this out. I did not include the form tags since i assumed they existed already in the parent master page. Once I added the form tags everything rendered perfectly.
    If u died right now, where wud u b?
    • Marked as answer by Rocky Giglio Friday, February 5, 2010 5:52 AM
    Friday, February 5, 2010 5:52 AM

All replies

  • Questions about ASP.NET should be asked at the ASP.NET Forums at http://forums.asp.net/ .  Please re-post your question there.


    P.S.  Your server tags render just fine on my machine...dropdownlist and all.
    Friday, February 5, 2010 4:26 AM
  • Please raise the ASP.NET issues on ASP.NET forum as John indicated. I am moving the thread from C# to Off-topic forum


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, February 5, 2010 5:42 AM
  • I figured this out. I did not include the form tags since i assumed they existed already in the parent master page. Once I added the form tags everything rendered perfectly.
    If u died right now, where wud u b?
    • Marked as answer by Rocky Giglio Friday, February 5, 2010 5:52 AM
    Friday, February 5, 2010 5:52 AM