943,949 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 1645
  • C# RSS
Jan 4th, 2009
0

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

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

c# 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:30 am.
Similar Threads
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008
Jan 4th, 2009
0

Re: TagPrefix and Assembly error

Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Jan 4th, 2009
0

Re: TagPrefix and Assembly error

Are you saying you want me to post it in ASP.NET forum ?!
I have already run a search for my query there and did not get any related issues.
May be i have to post the query there fr getting better answers.

Thanx.
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008
Jan 4th, 2009
0

Re: TagPrefix and Assembly error

Is the error on your machine or on the webserver you uploaded to? the asp.net forum would be better as this is a generic c# forum, the guys in the asp.net are more dedicated to webservers
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Jan 4th, 2009
0

Re: TagPrefix and Assembly error

Click to Expand / Collapse  Quote originally posted by LizR ...
Is the error on your machine or on the webserver you uploaded to? the asp.net forum would be better as this is a generic c# forum, the guys in the asp.net are more dedicated to webservers
Thnx , I posted it there..
The error is on my machine not on any webserver.
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 C# Forum Timeline: Open file dialog
Next Thread in C# Forum Timeline: Loop through all files in folder





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


Follow us on Twitter


© 2011 DaniWeb® LLC