473,320 Members | 1,988 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,320 software developers and data experts.

setting the Text Property of WebControl if possible

I have a function that has an Argument of type
System.Web.UI.WebControls.WebControl. I want to set the text-property
of that control. Of course it doesnt work if I cast that control to
(WebControl), because WebControl doesnt have a property Text.
Most Controls that inherit WebControl have text so I guess there must
be an common Interface implemented, but cant figure out what it is.
Goal would be something like:

private function translateCntrl(WebControl cntrl){
(ImaginaryControlTextType)cntrl.Text = translateString( cntrl.Text);
}

at the momemt i have tons of functions like

private function translateCntrl(Label cntrl){
(Label)cntrl.Text = translateString( cntrl.Text);
}
private function translateCntrl(Button cntrl){
(Button)cntrl.Text = translateString( cntrl.Text);
}
Nov 17 '05 #1
0 1276

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

Similar topics

18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
3
by: Janaka | last post by:
I've seen and used some samples where you can set the onclick attrubute to a Button control to get it to do some javascript a la : btnUse.Attributes = "DoSomeJS()"; However when i try and get...
2
by: Frédéric Mayot | last post by:
Hi, I have a strange behavior with a webcontrol. It seems that under some conditions, it's not possible to assign a value to a property. theControl is a ListBox theControl.DataSource =...
3
by: Earl Teigrob | last post by:
I have a class that has some fields and properties that I want to serialize. However, one of the fields is of type System.Web.UI.Webcontrols.Webcontrol and it will not serialize so I want to mark...
3
by: Shimon Sim | last post by:
I have control. One of the properties is implemented as StringCollection. I didn't use any Editor attribute for it. During Design time system shows dialog similar to Items in DropDownList but Add...
7
by: n33470 | last post by:
We're in the process of migrating our projects to use VS2005 from VS2003. We have a web page that uses the XML WebControl (System.Web.UI.WebControls.Xml) to perform an XSLT tranformation by...
1
by: shapper | last post by:
Hello, I have a class where I created various controls. One of the controls have a property which is a generic list of WebControl. Then in web site page I have something like: Dim a As New...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
4
by: Jeff | last post by:
hi asp.net 2.0 I have created a custom web control, here is it's header: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="EditUserBox.ascx.cs" Inherits="Controls_EditUserBox" %> ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.