2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes 2005 problems with "Register TagPrefix" and Partial Public Classes
2005 problems with "Register TagPrefix" and Partial Public Classes
Go Back  Xtreme Visual Basic Talk > > > 2005 problems with "Register TagPrefix" and Partial Public Classes


Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2007, 05:59 PM
PaTRiCKDRD PaTRiCKDRD is offline
Regular
 
Join Date: Oct 2003
Location: Greece, Athens
Posts: 69
Default 2005 problems with "Register TagPrefix" and Partial Public Classes


Hi all!

After having worked with .net 2003 for a while,
I had to switch to .net 2005 for my new job,
so I though to port my old job's site to .net 2005,
however, I am facing some problems:

1)
Code:
<%@ Register TagPrefix="uc1" TagName="GroupTabs" Src="~/baseControls/GroupTabs.ascx" %>
doesn't work,
because on the line (same file):
Code:
<uc1:GroupTabs id="ctl_GroupTabs" runat="server"></uc1:GroupTabs>
I get the message:
Code:
"Error 2 Name 'ctl_AppTabs' is not declared."
What on earth is going on?
This code was working flawlessly in .net 2003!

2) When trying to establish a reference between two partial public classes (ascx files),
I get the error
Code:
Type 'Header' is not defined
(Header is the other page)

3) How am I supposed to split a table using a master page, when it should have open tags in the header section, which would close in the footer section, but .net 2005 doesn't let me compile?

Thanks in advance!
Reply With Quote
  #2  
Old 01-19-2007, 06:56 PM
PaTRiCKDRD PaTRiCKDRD is offline
Regular
 
Join Date: Oct 2003
Location: Greece, Athens
Posts: 69
Default

I just found out that the 1st issue had to do with the second, I had a syntax error in this specific file, so,
how can I get a reference to the other ascx?

Does anyone know?
Reply With Quote
  #3  
Old 01-21-2007, 08:56 AM
wayneph's Avatar
wayneph2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Apparently I'm missing something... The Partial classes shouldn't affect anything. In the long run any Partial chunks get put back together and it works just like any other class.

What line of code gives you the "Type 'Header' is not defined" message? Maybe if we can see more of what you're trying to do, we could help more.

3. My first thought is that you're thinking too much like classic ASP. You shouldn't need to have your opening and closing tags in different controls. In a MasterPage you should be able to put the entire outer table. Then in your controls just put content.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #4  
Old 01-22-2007, 07:48 PM
PaTRiCKDRD PaTRiCKDRD is offline
Regular
 
Join Date: Oct 2003
Location: Greece, Athens
Posts: 69
Default

first file:
Code:
Partial Public Class Header
  Inherits BaseControl
second:
Code:
Partial Public Class AppTabs
  Inherits BaseControl

Dim hd As Header = CType(Page.Controls(0), Header)
When I write "Dim hd As " and hit Ctrl+Space (autocomplete),
"Header" is not shown!

Tried that using an empty web site with two partial public classes and couldn't make it work!
Reply With Quote
  #5  
Old 01-23-2007, 08:18 AM
wayneph's Avatar
wayneph2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Are these UserControls (.ascx and .ascx.vb files) or Custom Server Controls (just a .vb file)?

I assume since it's a partial class that it's an ASCX User Control...
I just tried it and in order to reference Header directly, I had to register the Header Control in the AppTabs Control. <%@ Register Src="Header.ascx" TagName="Header" TagPrefix="uc1" %>
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #6  
Old 01-23-2007, 08:40 AM
PaTRiCKDRD PaTRiCKDRD is offline
Regular
 
Join Date: Oct 2003
Location: Greece, Athens
Posts: 69
Default

I defined classname as somebody suggested,
but now got 'circular reference' error!

Code:
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Header.ascx.vb" Inherits="Header" CodeFileBaseClass="BaseControl" ClassName="Header" %>"uc1" TagName="GroupTabs" Src="~/baseControls/GroupTabs.ascx" %> <%@ Register TagPrefix="uc1" TagName="GroupTabs" Src="~/baseControls/GroupTabs.ascx" %>
  <td id="td_GroupHeaders"><uc1:GroupTabs id="ctl_GroupTabs" runat="server"></uc1:GroupTabs></td>
Code:
 Public Class Header
  Inherits BaseControl
Code:
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="GroupTabs.ascx.vb" Inherits="GroupTabs" CodeFileBaseClass="BaseControl" %>

<%@ Reference Control="Header.ascx" %>
Code:
Dim hd As Header = CType(Page.Controls(0), Header)
Reply With Quote
  #7  
Old 01-23-2007, 08:46 AM
wayneph's Avatar
wayneph2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

What are you trying to do? No code, just concepts. I think you've got this Object Oriented programming model all backwards.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes 2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
 
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
2005 problems with &quot;Register TagPrefix&quot; and Partial Public Classes
 
-->