View Single Post
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Tag Prefix and Assembly error

 
0
  #1
Jan 4th, 2009
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:

  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

  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.
Reply With Quote