473,698 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table cells background

Hi,
Can anyone tell me how to change a table cells background color or
background image in runtime with C#.

Karl-Inge
Mar 7 '06 #1
10 5695
You can use the cssClass attribute, e.g.

..TableCell1
{
background-image:url("imag es/Image1.gif");
}

and in your C# code:

TableCell td1= new TableCell();
td1.CssClass = "TableCell1 ";

//or you can add it without a CssClass like this:
td.Height = "100px";
td1.Width = "100px";
td1.Style.Add(" background-image", "url('image1.gi f')");
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,
Can anyone tell me how to change a table cells background color or
background image in runtime with C#.

Karl-Inge

Mar 7 '06 #2
Thanks Williams

Karl-Inge

"Phillip Williams" wrote:
You can use the cssClass attribute, e.g.

.TableCell1
{
background-image:url("imag es/Image1.gif");
}

and in your C# code:

TableCell td1= new TableCell();
td1.CssClass = "TableCell1 ";

//or you can add it without a CssClass like this:
td.Height = "100px";
td1.Width = "100px";
td1.Style.Add(" background-image", "url('image1.gi f')");
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,
Can anyone tell me how to change a table cells background color or
background image in runtime with C#.

Karl-Inge

Mar 8 '06 #3
Hi Phillips

Your suggestion help me in the right directions, but I have still problem.
I’m trying to make a tab style horizontal menu similar to that you use on top
of your web http://www.webswapp.com.

Do you have an example?

Karl-Inge
"Phillip Williams" wrote:
You can use the cssClass attribute, e.g.

.TableCell1
{
background-image:url("imag es/Image1.gif");
}

and in your C# code:

TableCell td1= new TableCell();
td1.CssClass = "TableCell1 ";

//or you can add it without a CssClass like this:
td.Height = "100px";
td1.Width = "100px";
td1.Style.Add(" background-image", "url('image1.gi f')");
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,
Can anyone tell me how to change a table cells background color or
background image in runtime with C#.

Karl-Inge

Mar 8 '06 #4
Hi Karl-Inge,

In displaying menu items on my website, I use a Button server control whose
cssClass is set with a background image that gives that impression of a Tab
(without the rectangular edges). The button has both the onmouseout and
onmouseover events changing the cssClass (which in turn displays a different
background image to the button).

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi Phillips

Your suggestion help me in the right directions, but I have still problem.
I’m trying to make a tab style horizontal menu similar to that you use on top
of your web http://www.webswapp.com.

Do you have an example?

Karl-Inge
"Phillip Williams" wrote:
You can use the cssClass attribute, e.g.

.TableCell1
{
background-image:url("imag es/Image1.gif");
}

and in your C# code:

TableCell td1= new TableCell();
td1.CssClass = "TableCell1 ";

//or you can add it without a CssClass like this:
td.Height = "100px";
td1.Width = "100px";
td1.Style.Add(" background-image", "url('image1.gi f')");
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,
Can anyone tell me how to change a table cells background color or
background image in runtime with C#.

Karl-Inge

Mar 8 '06 #5
Hi Phillip

Thanks for your help.

I can now change the buttons style with onmouseover and onmouseout.
My next problem is how I can reach a CSharp script when click the button.
Karl-Inge
"Phillip Williams" wrote:
Hi Karl-Inge,

In displaying menu items on my website, I use a Button server control whose
cssClass is set with a background image that gives that impression of a Tab
(without the rectangular edges). The button has both the onmouseout and
onmouseover events changing the cssClass (which in turn displays a different
background image to the button).

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi Phillips

Your suggestion help me in the right directions, but I have still problem.
I’m trying to make a tab style horizontal menu similar to that you use on top
of your web http://www.webswapp.com.

Do you have an example?

Karl-Inge
"Phillip Williams" wrote:
You can use the cssClass attribute, e.g.

.TableCell1
{
background-image:url("imag es/Image1.gif");
}

and in your C# code:

TableCell td1= new TableCell();
td1.CssClass = "TableCell1 ";

//or you can add it without a CssClass like this:
td.Height = "100px";
td1.Width = "100px";
td1.Style.Add(" background-image", "url('image1.gi f')");
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:

> Hi,
> Can anyone tell me how to change a table cells background color or
> background image in runtime with C#.
>
> Karl-Inge
>
>

Mar 8 '06 #6
Hi,

I found the solution. "onservercl ick" trigger C# event

Karl-Inge

"Karl-Inge Reknes" wrote:
Hi Phillip

Thanks for your help.

I can now change the buttons style with onmouseover and onmouseout.
My next problem is how I can reach a CSharp script when click the button.
Karl-Inge
"Phillip Williams" wrote:
Hi Karl-Inge,

In displaying menu items on my website, I use a Button server control whose
cssClass is set with a background image that gives that impression of a Tab
(without the rectangular edges). The button has both the onmouseout and
onmouseover events changing the cssClass (which in turn displays a different
background image to the button).

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi Phillips

Your suggestion help me in the right directions, but I have still problem.
I’m trying to make a tab style horizontal menu similar to that you use on top
of your web http://www.webswapp.com.

Do you have an example?

Karl-Inge
"Phillip Williams" wrote:

> You can use the cssClass attribute, e.g.
>
> .TableCell1
> {
> background-image:url("imag es/Image1.gif");
> }
>
> and in your C# code:
>
> TableCell td1= new TableCell();
> td1.CssClass = "TableCell1 ";
>
> //or you can add it without a CssClass like this:
> td.Height = "100px";
> td1.Width = "100px";
> td1.Style.Add(" background-image", "url('image1.gi f')");
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Karl-Inge Reknes" wrote:
>
> > Hi,
> > Can anyone tell me how to change a table cells background color or
> > background image in runtime with C#.
> >
> > Karl-Inge
> >
> >

Mar 9 '06 #7
You must have used an HtmlInputButton <input type="button"> object. If you
had used a Button server control it would have equally worked with the
Button.Click event, e..g

<asp:Button OnClick="Server Function"
onmouseover="th is.className='s omething';"
onmouseout="thi s.className='so methingelse';" Text="Menu1"
runat="sever"></asp:Button>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,

I found the solution. "onservercl ick" trigger C# event

Karl-Inge

"Karl-Inge Reknes" wrote:
Hi Phillip

Thanks for your help.

I can now change the buttons style with onmouseover and onmouseout.
My next problem is how I can reach a CSharp script when click the button.
Karl-Inge
"Phillip Williams" wrote:
Hi Karl-Inge,

In displaying menu items on my website, I use a Button server control whose
cssClass is set with a background image that gives that impression of a Tab
(without the rectangular edges). The button has both the onmouseout and
onmouseover events changing the cssClass (which in turn displays a different
background image to the button).

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:

> Hi Phillips
>
> Your suggestion help me in the right directions, but I have still problem.
> I’m trying to make a tab style horizontal menu similar to that you use on top
> of your web http://www.webswapp.com.
>
> Do you have an example?
>
> Karl-Inge
>
>
> "Phillip Williams" wrote:
>
> > You can use the cssClass attribute, e.g.
> >
> > .TableCell1
> > {
> > background-image:url("imag es/Image1.gif");
> > }
> >
> > and in your C# code:
> >
> > TableCell td1= new TableCell();
> > td1.CssClass = "TableCell1 ";
> >
> > //or you can add it without a CssClass like this:
> > td.Height = "100px";
> > td1.Width = "100px";
> > td1.Style.Add(" background-image", "url('image1.gi f')");
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Karl-Inge Reknes" wrote:
> >
> > > Hi,
> > > Can anyone tell me how to change a table cells background color or
> > > background image in runtime with C#.
> > >
> > > Karl-Inge
> > >
> > >

Mar 10 '06 #8
Thank you Phillip

Yes, I used HthmlInputButto n with runat=server, and that work fin.

Your suggestion work, but IntelliSense don’t give me the choose
“onmouseover, onmouseout” and I cant find information in Visual studio 2005
documentation that asp:button support this events?

Is it some basic information I have missed?

Karl-Inge Reknes


"Phillip Williams" wrote:
You must have used an HtmlInputButton <input type="button"> object. If you
had used a Button server control it would have equally worked with the
Button.Click event, e..g

<asp:Button OnClick="Server Function"
onmouseover="th is.className='s omething';"
onmouseout="thi s.className='so methingelse';" Text="Menu1"
runat="sever"></asp:Button>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,

I found the solution. "onservercl ick" trigger C# event

Karl-Inge

"Karl-Inge Reknes" wrote:
Hi Phillip

Thanks for your help.

I can now change the buttons style with onmouseover and onmouseout.
My next problem is how I can reach a CSharp script when click the button.
Karl-Inge
"Phillip Williams" wrote:

> Hi Karl-Inge,
>
> In displaying menu items on my website, I use a Button server control whose
> cssClass is set with a background image that gives that impression of a Tab
> (without the rectangular edges). The button has both the onmouseout and
> onmouseover events changing the cssClass (which in turn displays a different
> background image to the button).
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Karl-Inge Reknes" wrote:
>
> > Hi Phillips
> >
> > Your suggestion help me in the right directions, but I have still problem.
> > I’m trying to make a tab style horizontal menu similar to that you use on top
> > of your web http://www.webswapp.com.
> >
> > Do you have an example?
> >
> > Karl-Inge
> >
> >
> > "Phillip Williams" wrote:
> >
> > > You can use the cssClass attribute, e.g.
> > >
> > > .TableCell1
> > > {
> > > background-image:url("imag es/Image1.gif");
> > > }
> > >
> > > and in your C# code:
> > >
> > > TableCell td1= new TableCell();
> > > td1.CssClass = "TableCell1 ";
> > >
> > > //or you can add it without a CssClass like this:
> > > td.Height = "100px";
> > > td1.Width = "100px";
> > > td1.Style.Add(" background-image", "url('image1.gi f')");
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "Karl-Inge Reknes" wrote:
> > >
> > > > Hi,
> > > > Can anyone tell me how to change a table cells background color or
> > > > background image in runtime with C#.
> > > >
> > > > Karl-Inge
> > > >
> > > >

Mar 10 '06 #9
Those events are javascript. You'll have to write the event code yourself.

Karl-Inge Reknes wrote:
Thank you Phillip

Yes, I used HthmlInputButto n with runat=server, and that work fin.

Your suggestion work, but IntelliSense don’t give me the choose
“onmouseover, onmouseout” and I cant find information in Visual studio 2005
documentation that asp:button support this events?

Is it some basic information I have missed?

Karl-Inge Reknes


"Phillip Williams" wrote:
You must have used an HtmlInputButton <input type="button"> object. If you
had used a Button server control it would have equally worked with the
Button.Click event, e..g

<asp:Button OnClick="Server Function"
onmouseover="th is.className='s omething';"
onmouseout="thi s.className='so methingelse';" Text="Menu1"
runat="sever"></asp:Button>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Karl-Inge Reknes" wrote:
Hi,

I found the solution. "onservercl ick" trigger C# event

Karl-Inge

"Karl-Inge Reknes" wrote:

Hi Phillip

Thanks for your help.

I can now change the buttons style with onmouseover and onmouseout.
My next problem is how I can reach a CSharp script when click the button.
Karl-Inge
"Phillip Williams" wrote:

> Hi Karl-Inge,
>
> In displaying menu items on my website, I use a Button server control whose
> cssClass is set with a background image that gives that impression of a Tab
> (without the rectangular edges). The button has both the onmouseout and
> onmouseover events changing the cssClass (which in turn displays a different
> background image to the button).
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Karl-Inge Reknes" wrote:
>
>> Hi Phillips
>>
>> Your suggestion help me in the right directions, but I have still problem.
>> I’m trying to make a tab style horizontal menu similar to that you use on top
>> of your web http://www.webswapp.com.
>>
>> Do you have an example?
>>
>> Karl-Inge
>>
>>
>> "Phillip Williams" wrote:
>>
>>> You can use the cssClass attribute, e.g.
>>>
>>> .TableCell1
>>> {
>>> background-image:url("imag es/Image1.gif");
>>> }
>>>
>>> and in your C# code:
>>>
>>> TableCell td1= new TableCell();
>>> td1.CssClass = "TableCell1 ";
>>>
>>> //or you can add it without a CssClass like this:
>>> td.Height = "100px";
>>> td1.Width = "100px";
>>> td1.Style.Add(" background-image", "url('image1.gi f')");
>>> --
>>> HTH,
>>> Phillip Williams
>>> http://www.societopia.net
>>> http://www.webswapp.com
>>>
>>>
>>> "Karl-Inge Reknes" wrote:
>>>
>>>> Hi,
>>>> Can anyone tell me how to change a table cells background color or
>>>> background image in runtime with C#.
>>>>
>>>> Karl-Inge
>>>>
>>>>

--
Ray Booysen
rj********@rjb. za.net
Mar 10 '06 #10

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

Similar topics

0
2728
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there anyway to stop this...??? <HTML> <HEAD> <title>Conform Inbox</title> <meta content="False" name="vs_snapToGrid">
2
11263
by: Sugapablo | last post by:
Can anyone help me out with some code to change three table cells (<td>) when one is hovered over? I have a calendar grid where each day is made up of three table cells and I want all three to change color when any of the three are hovered over. I would prefer to do this with pure CSS if possible, but if Javascript is the only way...so be it. --
3
5905
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two table cells. This all renders correctly in MSIE 6.x, but doesn't in Firefox. In Firefox, the cell widths are reduced so that all the cells are displayed within the div frame. I've played around with this: commenting out css properties to see if...
31
5701
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a calendar, 7 across by whatever needed down, and I manually create it each month - not a big deal. Every day I go in and darken the background color of the current day's cell by changing the appropriate <TD> entry to <TD bgcolor="c63800"> and...
14
3410
by: lance | last post by:
Hi, I am a JS newbie. Hopefully the answer to my question is not trivial. I have written a simple webpage that presents a table. A JS function allows the viewer to click on a cell and each cell with the same content has the background color changed to lime green. Each cell that was previously highlighted has the background color changed back to white. This works great with Firefox but does not work correctly with IE. In IE, none...
7
5938
by: Johnny | last post by:
In MSIE table captions are displayed at the same size as content. But in Firefox the text displays at browser default, It also exceeds the width of the table and the excess is hidden if the table is enclosed in a bounding div. If caption is given a font-size (eg 0.8em) with CSS text it displays correctly, however MSIE then shows the text too small.
0
6098
by: Romulo NF | last post by:
Greetings again everyone Recently ive been asked to develop a script to allow filtering in the content of the table, with dinamic options based on the own content. Example: a table with the name of some students and their respective numbers, and then you wanna show only studentes called "Joao", or students with number "5", or even only students called "joao" with number "5". The structure we are going to use is a basic html table, like: ...
6
7995
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet ive developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data, call determined functions, and edit the data already present What will you need to use the grid? A table with standard markup and an ID to call the script that will turn the table into a grid Parameters: tabelaID => id of the table that will...
5
13781
by: Romulo NF | last post by:
Greetings, Im back here to show the new version of the drag & drop table columns (original script ). Ive found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now ive a new concept of the script, more object oriented. Ive also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
2
3020
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the length. <html> <head> <title>Rapid Blocking Interface</title> <style> .calendar {
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.