Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Random content

Reply
Thread Tools

Random content

 
 
Casper Hornstrup
Guest
Posts: n/a
 
      12-17-2003
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
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      12-23-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
 
 
 
 
Casper Hornstrup
Guest
Posts: n/a
 
      12-23-2003
<Source> and <Target> need to contain any valid ASP.NET tags. The a and div
tags are just examples.

"Ken Cox [Microsoft MVP]" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      12-23-2003
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" <(E-Mail Removed)> wrote in message news:#(E-Mail Removed)...
> <Source> and <Target> need to contain any valid ASP.NET tags. The a and div
> tags are just examples.
>
> "Ken Cox [Microsoft MVP]" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > >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

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
Random not really random... Maziar Aflatoun ASP .Net 4 08-05-2004 01:26 AM
Random NOt random? Darren Clark ASP .Net 3 06-24-2004 05:23 PM



Advertisments