![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| I created a thread about this issue before but it's re-appeared and was wondering if anyone had any ideas how to fix it permanently. I thought I'd start a new thread as I've narrowed down the problem to a small area. I have a few custom controls in my pages and every so often, normally after uploading a change to a BOL, DAL or BLL file the site will throw an exception saying so and so name is ambiguous in the namespace 'ASP'. It always relates to either these custom controls or my master page. The only way I've found to solve this issue is to include a ClassName in the Control declaration and call it some random name: Code: <@ Control Language="VB" ClassName="nvconcvr" codefile="client_tabs.ascx" inherits="client_tabs" %> When it happens I have to change the random class name in my custom controls and master page to something else. I've also tried it without classnames, but then it just throws an exception on the .NET generated names. I know it has something to do with the re-compiling when an App_Code file is uploaded, but wondered if there's anything I can do to resolve this permanently? I've googled loads about it, but no-one seems to have a solution, other than changing the names, which becomes a bit tedious when you're making changes, re-uploading, testing and then get this exception, so you have to change 3 files and re-upload those. Any ideas? |
| Sponsored Links |
|
#2
| ||||
| ||||
| You say you're changing the class name in the directive...what about the codebehind files? I also see this: codefile="client_tabs.ascx" Is that the name of your codebehind file AND your page? Typically, with codebehinds, I use an extension of .ascx.vb or .aspx.vb and for C#, .ascx.cs or aspx.cs.
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| My bad...I mis-typed the codefile name Code: <%@ Control Language="VB" ClassName="vdsfvdf" CodeFile="client_tabs.ascx.vb" Inherits="client_tabs" %> This is also the same in my Master page. I have to add a classname and give it a random value. I don't make any changes in the code behind. Last edited by richyrich; May 30th, 2008 at 09:42 AM. |
|
#4
| ||||
| ||||
| Typically, a master page would have the following directive: Code: <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> Post the main bits of your master page code behind file, leaving out anything you added after it was initially created. |
|
#5
| ||||
| ||||
| Sorry J. Maybe I wasn't explaining this right. I have a couple of custom controls that are included in some pages. The code I posted was the directive of one of the controls. If I include the ClassName attribute in the directive with some random letters, it works until it throws the ambiguous exception again, normally when I upload a changed DAL, BLL or BOL file. If I then change the ClassName for some different random letters, it works again. What I meant with regards to the master page was that once I get this error I get it for all the custom controls on the specifc page and the master page, so I have to change the random letters in the ClassName attribute of the directive for the controls and my Master page. Then it works again. Does that make more sense? What I was wondering was how to stop this error permanently. |
|
#6
| ||||
| ||||
| It sounds like the temporary files are not clearing out which could be causing this problem. What is your development environment. Are you on IIS? I believe there is a "Temporary ASP.Net Files" folder where your files are compiled to. You may have to manually clear this and see if it works. Also, try clearing IE cache. |
|
#8
| ||||
| ||||
| Their system just might slow at updating files. I had that problem with my host, as well. It might do you better to develop and test locally and then upload to their server. |
|
#9
| ||||
| ||||
| Tried it locally, but it won't connect to any of the MySQL servers. Just says:- Unable to connect to any of the specified MySQL hosts Can't think why as I use a fully qualified domain for the Data Source. Last edited by richyrich; May 30th, 2008 at 10:26 AM. |
|
#10
| ||||
| ||||
| Quote:
Unable to connect to any of the specified MySQL hosts - ASP.NET Forums |
![]() |
|
| Bookmarks |
| Tags |
| ambiguous, namespace |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| class name is ambiguous | richyrich | .Net Development | 11 | August 12th, 2008 11:11 AM |