HtmlGenericControl ID Property is not specified – ASP.Net (Visual Studio) | Khader’s Blog financial capital market equities fixed income derivative credit default swap binary option futures fix protocol fpml finance software

HtmlGenericControl ID Property is not specified – ASP.Net (Visual Studio)

Posted on 18. May, 2009 by khader in Other

You would see this quite often in Visual Studio (mainly 2008) while working with ASP.Net and User Controls. This is been very tricky. It is not actually a problem, but Visiual Studio could not render this control inside another page. It was kind of a pain not being able to see User control inside main pages. It took a while to figure it out.

If you are using HtmlGeneric controls (such as <body>, <div>, <span>, <p>, <link> etc) in your User Control they must have ‘ID’ attribute defined though you are not using it.

For example we had


<link href="~/App_Themes/Default/Default.css" runat="server" rel="stylesheet" type="text/css" />

All I need to do was add ‘id’ attribute to this tag as

<link href="~/App_Themes/Default/Default.css" runat="server" rel="stylesheet" type="text/css" id="dummy"/>

Cheers!

Share:
  • Facebook
  • Twitter
  • LinkedIn
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • MySpace
  • Technorati
  • RSS
  • email

Tags: , ,

2 Responses to “HtmlGenericControl ID Property is not specified – ASP.Net (Visual Studio)”

  1. Guy BAMI

    05. May, 2010

    Hi, very funny hint….

    but useful…

    Guy Bami W.

    Reply to this comment
  2. Rad

    07. Sep, 2010

    nice hint buddy…
    It addressed my problem.

    Reply to this comment

Leave a Reply