HighTechTalks DotNet Forums  

Random content

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Random content in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Casper Hornstrup
 
Posts: n/a

Default Random content - 12-17-2003 , 04:48 AM






I need to make a control that can be used like this:

<csite:LocalizedHint id="hint1" runat="server">
<csite:Target>
<a href="http://whereever.net"> my text</a>
</csite:Target>
<csite:Source>
<div class="special1">Click me!</div>
</csite:Source>
</csite:LocalizedHint>

Target and Source should be able to contain any controls and literal
content.
I, however, get the following parser error:

Type 'Localization.Target' does not have a property named 'a'.

How do I change Target and Source to accept anything?

Casper



Reply With Quote
  #2  
Old   
Ken Cox [Microsoft MVP]
 
Posts: n/a

Default Re: Random content - 12-22-2003 , 08:31 PM






Coud you use a PlaceHolder control and dynamically add a linkbutton control
to it? You could set the URL and target properties before adding the control
to the PlaceHolder controls collection.

Just an idea.


"Casper Hornstrup" <ch (AT) csite (DOT) com> wrote

Quote:
I need to make a control that can be used like this:

csite:LocalizedHint id="hint1" runat="server"
csite:Target
a href="http://whereever.net"> my text</a
/csite:Target
csite:Source
div class="special1">Click me!</div
/csite:Source
/csite:LocalizedHint

Target and Source should be able to contain any controls and literal
content.
I, however, get the following parser error:

Type 'Localization.Target' does not have a property named 'a'.

How do I change Target and Source to accept anything?

Casper





Reply With Quote
  #3  
Old   
Casper Hornstrup
 
Posts: n/a

Default Re: Random content - 12-23-2003 , 05:10 AM



<Source> and <Target> need to contain any valid ASP.NET tags. The a and div
tags are just examples.

"Ken Cox [Microsoft MVP]" <BANSPAMken_cox (AT) sympatico (DOT) ca> wrote

Quote:
Coud you use a PlaceHolder control and dynamically add a linkbutton
control
to it? You could set the URL and target properties before adding the
control
to the PlaceHolder controls collection.

Just an idea.


"Casper Hornstrup" <ch (AT) csite (DOT) com> wrote in message
news:uNgImLIxDHA.1076 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I need to make a control that can be used like this:

csite:LocalizedHint id="hint1" runat="server"
csite:Target
a href="http://whereever.net"> my text</a
/csite:Target
csite:Source
div class="special1">Click me!</div
/csite:Source
/csite:LocalizedHint

Target and Source should be able to contain any controls and literal
content.
I, however, get the following parser error:

Type 'Localization.Target' does not have a property named 'a'.

How do I change Target and Source to accept anything?

Casper







Reply With Quote
  #4  
Old   
Alessandro Zifiglio
 
Posts: n/a

Default Re: Random content - 12-23-2003 , 08:52 AM



hi casper, what you need to do is create two templates, in your case a target and a source template. Its actually very simple, heres an example from the docs.
what you do is define a template and child controls are in turn defined inline within this template. Dont forget to specify ParseChildren(true) on your main class. Its there on the examples

http://samples.gotdotnet.com/quickst...ate1.vb&font=3

More examples here on the main page :
http://samples.gotdotnet.com/quickst...authoring.aspx

Those examples pretty much cover everything and all you need to know. If you having problems postback
I would have answered sooner, somehow missed this post ;P

"Casper Hornstrup" <ch (AT) csite (DOT) com> wrote

Quote:
Source> and <Target> need to contain any valid ASP.NET tags. The a and div
tags are just examples.

"Ken Cox [Microsoft MVP]" <BANSPAMken_cox (AT) sympatico (DOT) ca> wrote in message
news:#MYBePPyDHA.3416 (AT) tk2msftngp13 (DOT) phx.gbl...
Coud you use a PlaceHolder control and dynamically add a linkbutton
control
to it? You could set the URL and target properties before adding the
control
to the PlaceHolder controls collection.

Just an idea.


"Casper Hornstrup" <ch (AT) csite (DOT) com> wrote in message
news:uNgImLIxDHA.1076 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I need to make a control that can be used like this:

csite:LocalizedHint id="hint1" runat="server"
csite:Target
a href="http://whereever.net"> my text</a
/csite:Target
csite:Source
div class="special1">Click me!</div
/csite:Source
/csite:LocalizedHint

Target and Source should be able to contain any controls and literal
content.
I, however, get the following parser error:

Type 'Localization.Target' does not have a property named 'a'.

How do I change Target and Source to accept anything?

Casper








Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.