Control 'LeftNav1_lnkCore' of type 'LinkButton' must be placed inside a form tag with
Please support our ASP.NET advertiser: DiscountASP.NET – 3 Months Free on ASP.NET 3.5/2.0 Web Hosting
![]() |
•
•
Posts: 10
Reputation:
Solved Threads: 0
Control 'LeftNav1_lnkCore' of type 'LinkButton' must be placed inside a form tag with
#1
Jan 7th, 2009
Hi All,
I have an application that i m developing in VS2003 using asp.net and c#
in the left navigation page I need to add the functionality to open and close a panel in the left nav.
here is my code:
---->
-------<
When I click on the link button lnkCore, i want to expand (i.e make the panel pnlCL visible.)
But I get the following error message that "Control 'LeftNav1_lnkCore' of type 'LinkButton' must be placed inside a form tag with runat="server""
i have done similar thing in my other application, and I didnt face any problem, What could the problem be?
Please help me.. i have been at this since morning!!!!!
Thanks in advance
I have an application that i m developing in VS2003 using asp.net and c#
in the left navigation page I need to add the functionality to open and close a panel in the left nav.
here is my code:
---->
asp.net Syntax (Toggle Plain Text)
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="LeftNav.ascx.cs" Inherits="CE.userControls.LeftNav" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> <td class="leftcolumn" valign="top"> <div id="snav"> <div class="subnav"> <ul class='navlink'> <li class='navlink3'> <asp:LinkButton ID="lnkCore" Runat="server" OnClick="lnkCore_Click" CausesValidation="False" > CCR </asp:LinkButton> </li> </ul> </div> <asp:Panel ID="pnlCl" Runat=server Visible="False"> <% Response.Write ("<div class='subnav'><ul class='navlink'><li class='navlink'"); int i=0; //for (int i=0;i<arrBlock.Count;i++) //{ string gyr = "0"; if (Convert.ToInt32(HttpContext.Current.Session["sesgyr"]) > 0) {gyr = HttpContext.Current.Session["sesgyr"].ToString().Trim();} //Response.Write ("<li class='navlink'>"); //if (bcode==(i+1)) {Response.Write ("<img src='/CE/images/arrow.down.png'>");} //else {Response.Write ("<img src='/CE/images/arrow.right.png'>");} //Response.Write (" <a href='/CE/default.aspx?b="+(i+1).ToString().Trim()+"'>"+arrBlock[i]+"</a></li>"); //if (bcode==(i+1)) //{ string ugr = HttpContext.Current.Session["sesusergroup"].ToString().Trim(); Response.Write ("<div class='subnav'><ul class='navlink'>"); for (int j=0;j<arrCoreBlock.Count;j++) { Response.Write ("<li class='navlink'><img src='/CE/images/arrow.right.png'> <font color=#00646E>"+arrCoreBlock[j]+"</font></li>"); Response.Write ("<table><tr>"); if (ugr!="CLINBLOCK1CCF" && ugr!="CLINBLOCK1MHMC" && ugr!="CLINBLOCK2CCF" && ugr!="CLINBLOCK2MHMC") {Response.Write ("<td bgcolor=#b0e0e6 border=1 bordercolor=#000000><a href='/CE/Components/blockCore.aspx?b=0&k="+(j+1).ToString().Trim()+"&h=1&y="+gyr+"'><font color=#00646E>UH/VA</font></a></td>");} if (ugr!="CLINBLOCK1CCF" && ugr!="CLINBLOCK1UH" && ugr!="CLINBLOCK2CCF" && ugr!="CLINBLOCK2UH") {Response.Write ("<td bgcolor=#f4a460 border=1 bordercolor=#000000><a href='/CE/Components/blockCore.aspx?b=0&k="+(j+1).ToString().Trim()+"&h=2&y="+gyr+"'><font color=#00646E>MHMC</font></a></td>");} if (ugr!="CLINBLOCK1UH" && ugr!="CLINBLOCK1MHMC" && ugr!="CLINBLOCK2UH" && ugr!="CLINBLOCK2MHMC") Response.Write ("<td bgcolor=#adff2f border=1 bordercolor=#000000><a href='/CE/Components/blockCore.aspx?b=0&k="+(j+1).ToString().Trim()+"&h=3&y="+gyr+"'><font color=#00646E>CCF</font></a></td>"); Response.Write ("</tr></table>"); } Response.Write ("</ul></div>"); //} //} Response.Write ("</ul></div>"); %> </asp:Panel> <% Response.Write ("<hr> <img src='/CE/images/arrow.right.png'>"); Response.Write (" <a href='/CE/components/cgTime.aspx'>Timeliness</a>"); %> <br class="header3"> </div> </td> <td id="tdMain"> <div class="paddedwrapper1"></div>
When I click on the link button lnkCore, i want to expand (i.e make the panel pnlCL visible.)
But I get the following error message that "Control 'LeftNav1_lnkCore' of type 'LinkButton' must be placed inside a form tag with runat="server""
i have done similar thing in my other application, and I didnt face any problem, What could the problem be?
Please help me.. i have been at this since morning!!!!!
Thanks in advance
Last edited by peter_budo : Jan 11th, 2009 at 1:46 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Re: Control 'LeftNav1_lnkCore' of type 'LinkButton' must be placed inside a form tag with
#2
Jan 7th, 2009
Every web controls with runat="server" attribute must be places inside <form runat="server" id="someID"> </form> tags.
If you use visual studio express editions or visual studio.net, you wont make such mistakes.
If you use visual studio express editions or visual studio.net, you wont make such mistakes.
Serkan Sendur
All my helpful posts are dedicated to Marty Friedman, especially for his song Forbidden City.
All my helpful posts are dedicated to Marty Friedman, especially for his song Forbidden City.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Accessing localhost problem
- Next Thread: How to implement live video streaming in asp.net
•
•
•
•
Views: 591 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode