Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Preview of ASP+ - Chapter 7


Message #1 by "Jeffrey Widmer" <jwidmer@o...> on Mon, 5 Mar 2001 12:20:18 -0500
I am up to the Implementing a Custom Control Builder section in Wrox's book

A Preview to Active Server Pages+.  I am rewriting the section into VB.Net

and I am having a problem translating Step 3 - Tell ASP+ to use a Custom

Control Builder on page 243.  The section says to:

"...add an attribute section to the class definition, and specify the

ControlBuilderAttribute attribute,"



The c# code is (placed outside of the class definition for

MyControlBuilder):



[

	ControlBuilderAttribute(typeof(MyControlBuilder))

]







Does anyone know how this would be written in VB.Net?  I have been able to

translate the rest of the chapter into VB.Net, but the last section is what

I am interested in, being able to specify nested html tags for your own user

defined controls such as:



<wrox:MyFirstControl id="table" rows="3" columns="5" runat="server" />

	<wrox:MyCell id="r1c1" value="testing" color="red" />

	<wrox:MyCell id="r2c1" value="testing2" color="blue" />

</wrox:MyFirstControl>



Any ideas?

Thanks in advance,

-Jeff





Message #2 by "Marcus Brim" <mbrim@h...> on Mon, 5 Mar 2001 11:22:18 -0600
Jeff - If you find the answer & get the control working, would you post the

source here?  I've had some problems getting that control to work - I think

it was because there were changes between beta 1 and the PDC...



Thanks

- marcus







----- Original Message -----

From: "Jeffrey Widmer" <jwidmer@o...>

To: "ASP+" <aspx@p...>

Sent: Monday, March 05, 2001 11:20 AM

Subject: [aspx] Preview of ASP+ - Chapter 7





> I am up to the Implementing a Custom Control Builder section in Wrox's

book

> A Preview to Active Server Pages+.  I am rewriting the section into VB.Net

> and I am having a problem translating Step 3 - Tell ASP+ to use a Custom

> Control Builder on page 243.  The section says to:

> "...add an attribute section to the class definition, and specify the

> ControlBuilderAttribute attribute,"

>

> The c# code is (placed outside of the class definition for

> MyControlBuilder):

>

> [

> ControlBuilderAttribute(typeof(MyControlBuilder))

> ]

>

>

>

> Does anyone know how this would be written in VB.Net?  I have been able to

> translate the rest of the chapter into VB.Net, but the last section is

what

> I am interested in, being able to specify nested html tags for your own

user

> defined controls such as:

>

> <wrox:MyFirstControl id="table" rows="3" columns="5" runat="server" />

> <wrox:MyCell id="r1c1" value="testing" color="red" />

> <wrox:MyCell id="r2c1" value="testing2" color="blue" />

> </wrox:MyFirstControl>

>

> Any ideas?

> Thanks in advance,

> -Jeff

>

>

>

>

Message #3 by "Jeffrey Widmer" <jwidmer@o...> on Mon, 5 Mar 2001 12:40:34 -0500
No problem, I'll post the code if I get it to work.  I'm going to try asking

ASPNGVB list and see if anyone there knows what the problem is.

-Jeff





-----Original Message-----

From: Marcus Brim [mailto:mbrim@h...]

Sent: Monday, March 05, 2001 12:22 PM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





Jeff - If you find the answer & get the control working, would you post the

source here?  I've had some problems getting that control to work - I think

it was because there were changes between beta 1 and the PDC...



Thanks

- marcus







----- Original Message -----

From: "Jeffrey Widmer" <jwidmer@o...>

To: "ASP+" <aspx@p...>

Sent: Monday, March 05, 2001 11:20 AM

Subject: [aspx] Preview of ASP+ - Chapter 7





> I am up to the Implementing a Custom Control Builder section in Wrox's

book

> A Preview to Active Server Pages+.  I am rewriting the section into VB.Net

> and I am having a problem translating Step 3 - Tell ASP+ to use a Custom

> Control Builder on page 243.  The section says to:

> "...add an attribute section to the class definition, and specify the

> ControlBuilderAttribute attribute,"

>

> The c# code is (placed outside of the class definition for

> MyControlBuilder):

>

> [

> ControlBuilderAttribute(typeof(MyControlBuilder))

> ]

>

>

>

> Does anyone know how this would be written in VB.Net?  I have been able to

> translate the rest of the chapter into VB.Net, but the last section is

what

> I am interested in, being able to specify nested html tags for your own

user

> defined controls such as:

>

> <wrox:MyFirstControl id="table" rows="3" columns="5" runat="server" />

> <wrox:MyCell id="r1c1" value="testing" color="red" />

> <wrox:MyCell id="r2c1" value="testing2" color="blue" />

> </wrox:MyFirstControl>

>

> Any ideas?

> Thanks in advance,

> -Jeff

>

>

>

>

Message #4 by "Susan Warren" <swarren@m...> on Mon, 5 Mar 2001 09:51:31 -0800
Jeff --



It looks like you are just trying to translate the attribute, right?  In

C# you declare an attribute on a class like this:



[ SomeAttribute ]

public class Foo {

....

}



The VB equivalent is:



Public Class <SomeAttribute> Foo

...

End Class



hth,

Susan





-----Original Message-----

From: Jeffrey Widmer [mailto:jwidmer@o...]

Sent: Monday, March 05, 2001 9:41 AM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





No problem, I'll post the code if I get it to work.  I'm going to try

asking

ASPNGVB list and see if anyone there knows what the problem is.

-Jeff





-----Original Message-----

From: Marcus Brim [mailto:mbrim@h...]

Sent: Monday, March 05, 2001 12:22 PM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





Jeff - If you find the answer & get the control working, would you post

the

source here?  I've had some problems getting that control to work - I

think

it was because there were changes between beta 1 and the PDC...



Thanks

- marcus







----- Original Message -----

From: "Jeffrey Widmer" <jwidmer@o...>

To: "ASP+" <aspx@p...>

Sent: Monday, March 05, 2001 11:20 AM

Subject: [aspx] Preview of ASP+ - Chapter 7





> I am up to the Implementing a Custom Control Builder section in Wrox's

book

> A Preview to Active Server Pages+.  I am rewriting the section into

VB.Net

> and I am having a problem translating Step 3 - Tell ASP+ to use a

Custom

> Control Builder on page 243.  The section says to:

> "...add an attribute section to the class definition, and specify the

> ControlBuilderAttribute attribute,"

>

> The c# code is (placed outside of the class definition for

> MyControlBuilder):

>

> [

> ControlBuilderAttribute(typeof(MyControlBuilder))

> ]

>

>

>

> Does anyone know how this would be written in VB.Net?  I have been

able to

> translate the rest of the chapter into VB.Net, but the last section is

what

> I am interested in, being able to specify nested html tags for your

own

user

> defined controls such as:

>

> <wrox:MyFirstControl id=3D"table" rows=3D"3" columns=3D"5" 

runat=3D"server" />

> <wrox:MyCell id=3D"r1c1" value=3D"testing" color=3D"red" />

> <wrox:MyCell id=3D"r2c1" value=3D"testing2" color=3D"blue" />

> </wrox:MyFirstControl>

>

> Any ideas?

> Thanks in advance,

> -Jeff



Message #5 by "Jeffrey Widmer" <jwidmer@o...> on Mon, 5 Mar 2001 14:08:17 -0500
Thanks Susan, that got me a little further.

Now I am trying:



	Public Class <ControlBuilderAttribute()> MyControlAttributes

	End Class



And I am getting the warning:



"No argument specified for the non-optional parameter 'builderType' of

methoed 'Sub New(builderType as System.Type)'."

With the blue line under the ControlBuilderAttribute piece of code.



I have tried specifying a type like:

	Public Class <ControlBuilderAttribute(MyControlBuilder.GetType)>

MyControlAttributes

	End Class



With MyControlBuilder being another class in my namespace but then I get the

warning:

"This reference to a non-shared member requires an object referenc, none is

supplied."



Do you know how I would specify the type?

Thanks in advance,

-Jeff





-----Original Message-----

From: Susan Warren [mailto:swarren@m...]

Sent: Monday, March 05, 2001 12:52 PM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





Jeff --



It looks like you are just trying to translate the attribute, right?  In

C# you declare an attribute on a class like this:



[ SomeAttribute ]

public class Foo {

....

}



The VB equivalent is:



Public Class <SomeAttribute> Foo

...

End Class



hth,

Susan





-----Original Message-----

From: Jeffrey Widmer [mailto:jwidmer@o...]

Sent: Monday, March 05, 2001 9:41 AM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





No problem, I'll post the code if I get it to work.  I'm going to try

asking

ASPNGVB list and see if anyone there knows what the problem is.

-Jeff



Message #6 by "Jeffrey Widmer" <jwidmer@o...> on Mon, 5 Mar 2001 23:23:18 -0500
Never mind, I answered my own question:



Public Class <ControlBuilderAttribute(GetType(MyControlBuilder))>

MyFirstControl

.....

End Class



-Jeff





-----Original Message-----

From: Jeffrey Widmer [mailto:jwidmer@o...]

Sent: Monday, March 05, 2001 2:08 PM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





Thanks Susan, that got me a little further.

Now I am trying:



	Public Class <ControlBuilderAttribute()> MyControlAttributes

	End Class



And I am getting the warning:



"No argument specified for the non-optional parameter 'builderType' of

methoed 'Sub New(builderType as System.Type)'."

With the blue line under the ControlBuilderAttribute piece of code.



I have tried specifying a type like:

	Public Class <ControlBuilderAttribute(MyControlBuilder.GetType)>

MyControlAttributes

	End Class



With MyControlBuilder being another class in my namespace but then I get the

warning:

"This reference to a non-shared member requires an object referenc, none is

supplied."



Do you know how I would specify the type?

Thanks in advance,

-Jeff





-----Original Message-----

From: Susan Warren [mailto:swarren@m...]

Sent: Monday, March 05, 2001 12:52 PM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





Jeff --



It looks like you are just trying to translate the attribute, right?  In

C# you declare an attribute on a class like this:



[ SomeAttribute ]

public class Foo {

....

}



The VB equivalent is:



Public Class <SomeAttribute> Foo

...

End Class



hth,

Susan





-----Original Message-----

From: Jeffrey Widmer [mailto:jwidmer@o...]

Sent: Monday, March 05, 2001 9:41 AM

To: ASP+

Subject: [aspx] Re: Preview of ASP+ - Chapter 7





No problem, I'll post the code if I get it to work.  I'm going to try

asking

ASPNGVB list and see if anyone there knows what the problem is.

-Jeff




  Return to Index