473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I dynamically set server control values in-line?

In ASP.NET 2.0 you can now apparently do this:
<asp:label runat="server" text="some browser" IE:text="any IE browser"
IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" />

Now the tokens "IE5" and "PIE" are coming from the updated browser
capabilities component.

I'd like to do the same thing, but create my own tokens that have nothing to
do with the browser capabilities component because I love the convenience
this offers.

For example I'd like to do this:

<asp:label runat="server" text="my val" Foo:text="val when Foo"
Bar:text="value when bar" />

or even this:

<asp:label runat="server" text="some browser"
Condition==True:text="condition is true" Condition==False:text="condition
is false" />

So in summary, is this possible out of the box in asp.net 2.0? If not, is
it possible to extend the asp:label (or other such controls) somehow to
support this conditional assignment of a propery?

Obviously the updated browser capabilities control does this, so it must be
possible somehow. I guess the question is whether this support is hard coded
into the asp.net framework specific to the browser control, or whether this
is an open architecture that somehow I can tap into to do the same thing.

Any advice would be greatly appreciated! Thanks!!

Steve

Nov 19 '05 #1
2 2063
Don't know if its there in 2.0 but you could (I would assume) simply create a
series of custom controls inheriting from the base ones, that adds this
parameter and then you do a If/Switch check in the custom control.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Steve Franks" wrote:
In ASP.NET 2.0 you can now apparently do this:
<asp:label runat="server" text="some browser" IE:text="any IE browser"
IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" />

Now the tokens "IE5" and "PIE" are coming from the updated browser
capabilities component.

I'd like to do the same thing, but create my own tokens that have nothing to
do with the browser capabilities component because I love the convenience
this offers.

For example I'd like to do this:

<asp:label runat="server" text="my val" Foo:text="val when Foo"
Bar:text="value when bar" />

or even this:

<asp:label runat="server" text="some browser"
Condition==True:text="condition is true" Condition==False:text="condition
is false" />

So in summary, is this possible out of the box in asp.net 2.0? If not, is
it possible to extend the asp:label (or other such controls) somehow to
support this conditional assignment of a propery?

Obviously the updated browser capabilities control does this, so it must be
possible somehow. I guess the question is whether this support is hard coded
into the asp.net framework specific to the browser control, or whether this
is an open architecture that somehow I can tap into to do the same thing.

Any advice would be greatly appreciated! Thanks!!

Steve

Nov 19 '05 #2
The main advantage I am looking to gain from this is the abilty to specify
different values within the server tag itself. If I created a custom control
that did the if/switch type of logic there, wouldn't that basically require
me to hard code the values in there?

Really what I am looking for is the ability to specify different values
within the server control itself (i.e. something:text="TEXT 1"
somethingElse:text="ALTERNATE TEXT" and then let the control pick which one
to use, using business logic. Is that approach possible with a custom
control?

Thanks,

Steve

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:D1**********************************@microsof t.com...
Don't know if its there in 2.0 but you could (I would assume) simply
create a
series of custom controls inheriting from the base ones, that adds this
parameter and then you do a If/Switch check in the custom control.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Steve Franks" wrote:
In ASP.NET 2.0 you can now apparently do this:
<asp:label runat="server" text="some browser" IE:text="any IE browser"
IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" />

Now the tokens "IE5" and "PIE" are coming from the updated browser
capabilities component.

I'd like to do the same thing, but create my own tokens that have nothing
to
do with the browser capabilities component because I love the convenience
this offers.

For example I'd like to do this:

<asp:label runat="server" text="my val" Foo:text="val when Foo"
Bar:text="value when bar" />

or even this:

<asp:label runat="server" text="some browser"
Condition==True:text="condition is true"
Condition==False:text="condition
is false" />

So in summary, is this possible out of the box in asp.net 2.0? If not,
is
it possible to extend the asp:label (or other such controls) somehow to
support this conditional assignment of a propery?

Obviously the updated browser capabilities control does this, so it must
be
possible somehow. I guess the question is whether this support is hard
coded
into the asp.net framework specific to the browser control, or whether
this
is an open architecture that somehow I can tap into to do the same thing.

Any advice would be greatly appreciated! Thanks!!

Steve

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Billy | last post by:
I have a web page with a control (Control#A) on it. The control (#A) has a control (Control#B) on it which displays an exception message when set and displayed. I am creating a simple datagrid...
2
by: Stephen Miller | last post by:
When I dynamically populate a HtmlSelect combo box, the Value property consistently fails to return the item selected, defaulting instead to the first item in the list. For example: Protected...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
3
by: Jen | last post by:
Hi I have created some controls (HtmlInputText, HtmlGenericControl, TextBox) dynamically. But I have problem getting the values from these controls to save them. Is there a way to do that? ...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
8
by: utterberg | last post by:
Hi I'm adding two dropdownlist in my webform by clicking a button. I fill the first dropdown with some values from my DB and the other one when I choose from the first dropdown. But since theese...
3
by: Dotnet Gruven | last post by:
I've built a WebForm with a Table added dynamically in Page_Load when IsPostBack is false. The table includes a couple of TextBoxes, RadioButtonLists and CheckboxLists. On postback, those...
5
by: arnabit | last post by:
I have created a dropdown ,which is inside a panel and the panel is inside a place holder . the panel and the dropdown is created dynamically. I do have a button when the button is clicked i am...
5
by: Nathan Sokalski | last post by:
I have a custom control that I wrote (I inherit from System.Web.UI.WebControls.CompositeControl). I dynamically add this control to my Page, but I was told that dynamically added controls do not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.