Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is it possible to set the Text property of more than one literal in one go?

Reply
Thread Tools

Is it possible to set the Text property of more than one literal in one go?

 
 
Alan Silver
Guest
Posts: n/a
 
      06-29-2005
Hello,

Suppose I have a page that has several literal controls and I want to be
able to set the Text property of these controls all to the same value.
Is there a simple way of doing this?

The example in hand is where I want to set both the <title> tag and a
<h1> tag on the body of the page to show the name of the product being
displayed. I know I can do this in two lines, but I was wondering if
there is a way doing it in one go, so if I need to use the product name
elsewhere, I can just add another control and not need to remember to go
back and add an extra line to set the Text.

Any ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      06-29-2005
Alan Silver wrote:
> Hello,
>
> Suppose I have a page that has several literal controls and I want to be
> able to set the Text property of these controls all to the same value.
> Is there a simple way of doing this?
>
> The example in hand is where I want to set both the <title> tag and a
> <h1> tag on the body of the page to show the name of the product being
> displayed. I know I can do this in two lines, but I was wondering if
> there is a way doing it in one go, so if I need to use the product name
> elsewhere, I can just add another control and not need to remember to go
> back and add an extra line to set the Text.
>
> Any ideas? TIA
>


use a variable to hold it... but in the end its still multiple lines

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      06-29-2005
>> Hello,
>> Suppose I have a page that has several literal controls and I want
>>to be able to set the Text property of these controls all to the same
>>value. Is there a simple way of doing this?
>> The example in hand is where I want to set both the <title> tag and
>>a <h1> tag on the body of the page to show the name of the product
>>being displayed. I know I can do this in two lines, but I was
>>wondering if there is a way doing it in one go, so if I need to use
>>the product name elsewhere, I can just add another control and not
>>need to remember to go back and add an extra line to set the Text.
>> Any ideas? TIA

>
>use a variable to hold it... but in the end its still multiple lines


OK thanks, it was just an idea.

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
intrader
Guest
Posts: n/a
 
      07-01-2005
On Wed, 29 Jun 2005 18:59:09 +0100, Alan Silver wrote:

> Hello,
>
> Suppose I have a page that has several literal controls and I want to be
> able to set the Text property of these controls all to the same value.
> Is there a simple way of doing this?
>
> The example in hand is where I want to set both the <title> tag and a
> <h1> tag on the body of the page to show the name of the product being
> displayed. I know I can do this in two lines, but I was wondering if
> there is a way doing it in one go, so if I need to use the product name
> elsewhere, I can just add another control and not need to remember to go
> back and add an extra line to set the Text.
>
> Any ideas? TIA

What about overriding the Render method, catching the output of the base
class, then using string replace to change the stuff.

Or
Use <%=something%> at the appropriate places and give a values to
something

 
Reply With Quote
 
Alan Silver
Guest
Posts: n/a
 
      07-03-2005
>> Suppose I have a page that has several literal controls and I want to be
>> able to set the Text property of these controls all to the same value.
>> Is there a simple way of doing this?
>>
>> The example in hand is where I want to set both the <title> tag and a
>> <h1> tag on the body of the page to show the name of the product being
>> displayed. I know I can do this in two lines, but I was wondering if
>> there is a way doing it in one go, so if I need to use the product name
>> elsewhere, I can just add another control and not need to remember to go
>> back and add an extra line to set the Text.
>>
>> Any ideas? TIA

>What about overriding the Render method, catching the output of the base
>class, then using string replace to change the stuff.


Ulp, not sure I'd know how to do that!! It sounds a bit beyond my
limited capabilities at the moment.

Where would I find more info about how this is done? Maybe I'll look and
see.

>Or
>Use <%=something%> at the appropriate places and give a values to
>something


Funny, as an ex-Classic ASP programmer, I've studiously avoided using
<%=%> as it sounds like the "old" way of doing things. It never even
crossed my mind to do it that way!! I guess I'm trying to get my head
into the OOP way of looking at web pages, and this doesn't really fit
with that.


Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
 
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
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
library implementation strncpy() modifies string literal, legal? more doubts need more suggestion? lovecreatesbeauty C Programming 17 06-16-2006 06:34 PM
What's wrong with rpc-literal? Why use doc-literal? Anonieko Ramos ASP .Net Web Services 0 09-27-2004 09:06 AM



Advertisments