943,708 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 3523
  • ASP.NET RSS
Jan 4th, 2009
0

Tag Prefix and Assembly error

Expand Post »
Hi all,

I am trying to create Web Controls and i am getting this error:

Could not load file or assembly 'Microsoft.Web.UI.WebControls' or one of its dependencies. The system cannot find the file specified.


i inserted all respective directives and namespaces at the begining of the page and also in the web.config file. But it still says it cannot find the file specified.

My code goes as following:

ASP.NET Syntax (Toggle Plain Text)
  1.  
  2. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="toolbars.aspx.cs" Inherits="toolbars" %>
  3. <%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
  4. <%@ Register TagPrefix="webControls"
  5. Namespace="Microsoft.Web.UI.WebControls"
  6. Assembly="Microsoft.Web.UI.WebControls" %>
  7.  
  8.  
  9. <html >
  10. <head runat="server">
  11. <title>Untitled Page</title>
  12. <script language="c#" runat="server">
  13. public void buttonSelected(Object sender, EventArgs e)
  14. {
  15. string name;
  16. name = sender.ToString();
  17. Response.Write(name);
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <form id="form1" runat="server">
  23. <div>
  24. <h1>USING TOOLBAR ELEMENTS</h1>
  25. <webControls:Toolbar id="toolbar" runat="server" onButtonClick="buttonSelected" >
  26. <webControls:ToolbarButton id="home" Text="Home" />
  27. <webControls:ToolbarButton id="call" Text="Callus" />
  28. </webControls:Toolbar>
  29. </div>
  30. </form>
  31. </body>
  32. </html>


i inserted the tagprefix in the page elements section of the web.config file too as following

ASP.NET Syntax (Toggle Plain Text)
  1. :
  2. :
  3. :
  4. :
  5.  
  6. <pages enableViewStateMac="false" >
  7. <controls>
  8. <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  9. <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  10. <add tagPrefix="webControls" namespace="Microsoft.Web.UI.WebControls" assembly="Microsoft.Web.UI.WebControls" />
  11. </controls>
  12. </pages>
  13. :
  14. :
  15. :
  16. :
Thanks in advance.
Last edited by csharplearner; Jan 4th, 2009 at 12:04 pm.
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008
Jan 5th, 2009
0

Re: Tag Prefix and Assembly error

The problem is exactly what the error says. The compiler cannot find Microsoft.Web.UI.WebControls in your project. I'm assuming this is the library for IE controls because i don't recognize it as part of the standard libraries. Hence, you probably need to download it, locate it on your machine and reference it in your project.
Reputation Points: 31
Solved Threads: 7
Light Poster
iDeveloper is offline Offline
49 posts
since Jul 2008
Jan 5th, 2009
0

Re: Tag Prefix and Assembly error

Click to Expand / Collapse  Quote originally posted by iDeveloper ...
The problem is exactly what the error says. The compiler cannot find Microsoft.Web.UI.WebControls in your project. I'm assuming this is the library for IE controls because i don't recognize it as part of the standard libraries. Hence, you probably need to download it, locate it on your machine and reference it in your project.
I downloaded trial version of Visual Studio 2008 Professional.. so doesnt it come with the package?
Can u please tell how to check if a particular library is present in the package or not?!
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Roles.IsUserInRole() can't get it work !!!
Next Thread in ASP.NET Forum Timeline: Login Controls





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC