Problem with custom server control
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.


Frans, Stephen
-- Copied from [aspngreuse] to [aspngcontrolsvb] by David L. Penton <Click here to reveal e-mail address> --This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible.------_=_NextPart_001_01C17440.0361EBC4Content-Type: text/plainI am having problems with custom server controls that use some of the VBbuilt in functions (e.g., UCase and LCase). I have created a totallystripped down custom server control and have the same behavior. When Icompile the control foo.vb I get the following error: C:\Inetpub\wwwroot\VSTest>vbc /t:library /r:system.dll,system.web.dll foo.vbMicrosoft (R) Visual Basic.NET Compiler version 7.00.9254for Microsoft (R) .NET CLR version 1.00.2914.16Copyright (C) Microsoft Corp 2001. All rights reserved. C:\Inetpub\wwwroot\VSTest\foo.vb(13) : error BC30451: The name 'UCase' isnot declared. Return UCase(_oldValue) ~~~~~ The code for my stripped down control is: Imports SystemImports System.Web.UI Namespace IIGControls Public Class IIGTextBox Inherits System.Web.UI.WebControls.TextBox ' private attributes Private _oldValue As String = "" ReadOnly Property oldValue() As String Get Return UCase(_oldValue) End Get End Property End ClassEnd Namespace The puzzling thing is that it seems to compile successfully in VS.NET, butnot from the VBC command line. However, the VS.NET compile does not producea DLL that I can copy to the \bin folder. I have tried this on othermachines with the same result, so I don't think it is my configuration -rather it must be either the code or the compilation command line. Ithought, perhaps, that these functions (UCase, LCase, etc.) live in a DLLthat I was not referencing (/r:xx), but cannot find one including these VBPublic functions. Has anyone run into this problem? Lastly, I had asked before, is there a way to debug into a custom servercontrol? (one that compiles successfully, of course) I can set a breakpointin VS.NET in my server control, but the debugger refuses to stop there. Thanks again, Steve------_=_NextPart_001_01C17440.0361EBC4Content-Type: text/htmlContent-Transfer-Encoding: quoted-printable<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =xmlns:w=3D"urn:schemas-microsoft-com:office:word" =xmlns=3D"http://www.w3.org/TR/REC-html40";><head><META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =charset=3DUS-ASCII"><meta name=3DProgId content=3DWord.Document><meta name=3DGenerator content=3D"Microsoft Word 10"><meta name=3DOriginator content=3D"Microsoft Word 10"><link rel=3DFile-List href=3D"cid:filelist.xml@01C17416.0D0F65E0"><!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings></xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument></xml><![endif]--><style><!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal    {mso-style-parent:"";    margin:0in;    margin-bottom:.0001pt;    mso-pagination:widow-orphan;    font-size:11.0pt;    font-family:Arial;    mso-fareast-font-family:"Times New Roman";}a:link, span.MsoHyperlink    {color:blue;    text-decoration:underline;    text-underline:single;}a:visited, span.MsoHyperlinkFollowed    {color:purple;    text-decoration:underline;    text-underline:single;}span.EmailStyle17    {mso-style-type:personal-compose;    mso-style-noshow:yes;    mso-ansi-font-size:10.0pt;    mso-bidi-font-size:10.0pt;    font-family:Arial;    mso-ascii-font-family:Arial;    mso-hansi-font-family:Arial;    mso-bidi-font-family:Arial;    color:windowtext;}span.SpellE    {mso-style-name:"";    mso-spl-e:yes;}span.GramE    {mso-style-name:"";    mso-gram-e:yes;}@page Section1    {size:8.5in 11.0in;    margin:1.0in 1.25in 1.0in 1.25in;    mso-header-margin:.5in;    mso-footer-margin:.5in;    mso-paper-source:0;}div.Section1    {page:Section1;}--></style><!--[if gte mso 10]><style> /* Style Definitions */=20 table.MsoNormalTable    {mso-style-name:"Table Normal";    mso-tstyle-rowband-size:0;    mso-tstyle-colband-size:0;    mso-style-noshow:yes;    mso-style-parent:"";    mso-padding-alt:0in 5.4pt 0in 5.4pt;    mso-para-margin:0in;    mso-para-margin-bottom:.0001pt;    mso-pagination:widow-orphan;    font-size:10.0pt;    font-family:"Times New Roman";}</style><![endif]--></head><body lang=3DEN-US link=3Dblue vlink=3Dpurple =style=3D'tab-interval:.5in'><div class=3DSection1><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>I amhaving problems with custom server controls that use some of the VB =built infunctions (e.g., UCase and LCase).<span =style=3D'mso-spacerun:yes'> </span>I have created a totally stripped down custom server control and =havethe same behavior.<span style=3D'mso-spacerun:yes'>  </span>When I =compilethe control foo.vb I get the following =error:<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>C:\Inetpub\wwwroot\VSTest>vbc /t<span =class=3DGramE>:library</span>/r:system.dll,system.web.dll foo.vb<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>Microsoft (R) Visual Basic.NET Compiler version =7.00.9254<o:p></o:p></span></font></b></p><p class=3DMsoNormal><span class=3DGramE><b =style=3D'mso-bidi-font-weight:normal'><fontsize=3D2 face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>for</span></font></b></span><b =style=3D'mso-bidi-font-weight:normal'><fontsize=3D2><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'> Microsoft (R) .NET CLR version =1.00.2914.16<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>Copyright (C) Microsoft Corp 2001. All rights =reserved.<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>C:\Inetpub\wwwroot\VSTest\<span class=3DGramE>foo.vb(</span>13) =: errorBC30451: The name 'UCase' is not =declared.<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       &nb=sp;       </span>Return <span =class=3DGramE>UCase(</span>_oldValue)<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       &nb=sp;           &nb=sp;  </span>~~~~~<o:p></o:p></span></font></b></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Thecode for my stripped down control is:<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>Imports System<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>Imports System.Web.UI<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>Namespace IIGControls<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><span style=3D'mso-spacerun:yes'>    =</span>Public ClassIIGTextBox<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       </span>Inherits =System.Web.UI.WebControls.TextBox<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-f=ont-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>        =</span><spanclass=3DGramE>' private</span> =attributes<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       </span>Private _oldValue As String =3D =""<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       </span>ReadOnly Property <span class=3DGramE>oldValue(</span>) As =String<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       &nb=sp;   </span>Get<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       &nb=sp;       </span>Return <span =class=3DGramE>UCase(</span>_oldValue)<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>       &nb=sp;   </span>End Get<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><spanstyle=3D'mso-spacerun:yes'>        =</span>EndProperty<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><o:p> </o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'><span style=3D'mso-spacerun:yes'>    </span>End =Class<o:p></o:p></span></font></b></p><p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =size=3D2face=3DArial><span =style=3D'font-size:10.0pt;font-weight:bold;mso-bidi-font-weight:normal'>End Namespace<o:p></o:p></span></font></b></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Thepuzzling thing is that it seems to compile successfully in VS.NET, but =not fromthe VBC command line.<span style=3D'mso-spacerun:yes'>  =</span>However, theVS.NET compile does not produce a DLL that I can copy to the \bin =folder.<spanstyle=3D'mso-spacerun:yes'>  </span>I have tried this on other =machines withthe same result, so I don't think it is my configuration - rather it =mustbe either the code or the compilation command line. I thought, perhaps, =thatthese functions (UCase, LCase, etc.) live in a DLL that I was not =referencing (/r<spanclass=3DGramE>:xx</span>), but cannot find one including these VB =Publicfunctions.<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Hasanyone run into this problem?<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Lastly,I had asked before, is there a way to debug into a custom server =control? (<spanclass=3DGramE>one</span> that compiles successfully, of course)<spanstyle=3D'mso-spacerun:yes'>  </span>I can set a breakpoint in =VS.NET in myserver control, but the debugger refuses to stop =there.<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Thanksagain,<o:p></o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'><o:p> </o:p></span></font></p><p class=3DMsoNormal><font size=3D2 face=3DArial><span =style=3D'font-size:10.0pt'>Steve<o:p></o:p></span></font></p></div></body></html>------_=_NextPart_001_01C17440.0361EBC4--
Reply to this message...
 
    
Gary Lewis
I am having problems with custom server controls that use some of the VB
built in functions (e.g., UCase and LCase). I have created a totally
stripped down custom server control and have the same behavior. When I
compile the control foo.vb I get the following error:

C:\Inetpub\wwwroot\VSTest>vbc /t:library /r:system.dll,system.web.dll foo.vb
Microsoft (R) Visual Basic.NET Compiler version 7.00.9254
for Microsoft (R) .NET CLR version 1.00.2914.16
Copyright (C) Microsoft Corp 2001. All rights reserved.

C:\Inetpub\wwwroot\VSTest\foo.vb(13) : error BC30451: The name 'UCase' is
not declared.

Return UCase(_oldValue)
~~~~~

The code for my stripped down control is:

Imports System
Imports System.Web.UI

Namespace IIGControls
Public Class IIGTextBox
Inherits System.Web.UI.WebControls.TextBox

' private attributes
Private _oldValue As String = ""

ReadOnly Property oldValue() As String
Get
Return UCase(_oldValue)
End Get
End Property

End Class
End Namespace

The puzzling thing is that it seems to compile successfully in VS.NET, but
not from the VBC command line. However, the VS.NET compile does not produce
a DLL that I can copy to the \bin folder. I have tried this on other
machines with the same result, so I don't think it is my configuration -
rather it must be either the code or the compilation command line. I
thought, perhaps, that these functions (UCase, LCase, etc.) live in a DLL
that I was not referencing (/r:xx), but cannot find one including these VB
Public functions.

Has anyone run into this problem?

Lastly, I had asked before, is there a way to debug into a custom server
control? (one that compiles successfully, of course) I can set a breakpoint
in VS.NET in my server control, but the debugger refuses to stop there.

Thanks again,

Steve
Reply to this message...
 
 
System.Web.UI.WebControls.TextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com