473,320 Members | 1,854 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.

Changing a table properties in ASP.NET

This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't seem to
find a way to do this through my Page_Load event like I thought I would
because I can't grab the table object. The table has an ID so I don't see
why I can't reference it in my event. Can anyone shed some light on how to
go about this. Oh, I'm new to ASP.NET but do VB.NET often, so I may be
missing some simple ASP concept...

Thank
Chris
Nov 18 '05 #1
7 1404
is it a <table...>
or <asp:Table...>
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't seem to find a way to do this through my Page_Load event like I thought I would
because I can't grab the table object. The table has an ID so I don't see
why I can't reference it in my event. Can anyone shed some light on how to go about this. Oh, I'm new to ASP.NET but do VB.NET often, so I may be
missing some simple ASP concept...

Thank
Chris

Nov 18 '05 #2
It is an <table>

I hope there is a way to do this without asp:table since the asp:table
appears harder to format my controls on the screen correctly, but that just
may be me unfamiliar with it. Can I do this change the table properties
with a <table>?

Thanks

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OC**************@tk2msftngp13.phx.gbl...
is it a <table...>
or <asp:Table...>
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't seem
to
find a way to do this through my Page_Load event like I thought I would
because I can't grab the table object. The table has an ID so I don't

see why I can't reference it in my event. Can anyone shed some light on how

to
go about this. Oh, I'm new to ASP.NET but do VB.NET often, so I may be
missing some simple ASP concept...

Thank
Chris


Nov 18 '05 #3
somewhat....use the
tablename.Attributes["style"] = "yourstyletags";
Again though, it's only TABLE LEVEL items that will be available, not row,
cell, etc...

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
It is an <table>

I hope there is a way to do this without asp:table since the asp:table
appears harder to format my controls on the screen correctly, but that just may be me unfamiliar with it. Can I do this change the table properties
with a <table>?

Thanks

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OC**************@tk2msftngp13.phx.gbl...
is it a <table...>
or <asp:Table...>
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't seem
to
find a way to do this through my Page_Load event like I thought I would because I can't grab the table object. The table has an ID so I don't see why I can't reference it in my event. Can anyone shed some light on how to
go about this. Oh, I'm new to ASP.NET but do VB.NET often, so I may

be missing some simple ASP concept...

Thank
Chris



Nov 18 '05 #4
Jos
Chris wrote:
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't
seem to find a way to do this through my Page_Load event like I
thought I would because I can't grab the table object. The table has
an ID so I don't see why I can't reference it in my event. Can
anyone shed some light on how to go about this. Oh, I'm new to
ASP.NET but do VB.NET often, so I may be missing some simple ASP
concept...

Thank
Chris


Did you add the runat="server" attribute?
After that, you can reference your table (it will take the type of
HtmlTable). Use the Rows property to address the different
rows.

--

Jos Branders
Nov 18 '05 #5
Thanks Joe, that is what I was missing, but now the new question is why I
can't access a nested Table by name.

I can see the second table my going down through the first one
OuterTable.Rows(1).Cells(0).Controls(1).ID but I can't just reference the
table named Inner when I put runat="server" on the table line. Any
Thoughts?

Chris



"Jos" <jo***************@fastmail.fm> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Chris wrote:
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't
seem to find a way to do this through my Page_Load event like I
thought I would because I can't grab the table object. The table has
an ID so I don't see why I can't reference it in my event. Can
anyone shed some light on how to go about this. Oh, I'm new to
ASP.NET but do VB.NET often, so I may be missing some simple ASP
concept...

Thank
Chris


Did you add the runat="server" attribute?
After that, you can reference your table (it will take the type of
HtmlTable). Use the Rows property to address the different
rows.

--

Jos Branders

Nov 18 '05 #6
Make sure it's being defined in the code-behind. Often nested server
controls will fail to auto-generate the necessary code-behind.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:OF**************@TK2MSFTNGP12.phx.gbl...
Thanks Joe, that is what I was missing, but now the new question is why I
can't access a nested Table by name.

I can see the second table my going down through the first one
OuterTable.Rows(1).Cells(0).Controls(1).ID but I can't just reference the
table named Inner when I put runat="server" on the table line. Any
Thoughts?

Chris



"Jos" <jo***************@fastmail.fm> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Chris wrote:
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't
seem to find a way to do this through my Page_Load event like I
thought I would because I can't grab the table object. The table has
an ID so I don't see why I can't reference it in my event. Can
anyone shed some light on how to go about this. Oh, I'm new to
ASP.NET but do VB.NET often, so I may be missing some simple ASP
concept...

Thank
Chris


Did you add the runat="server" attribute?
After that, you can reference your table (it will take the type of
HtmlTable). Use the Rows property to address the different
rows.

--

Jos Branders


Nov 18 '05 #7
Sorry, it does seem to be working... Don't know what I did wrong. Thanks a
Ton.

Chris

"Jos" <jo***************@fastmail.fm> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Chris wrote:
This should have been easy but I can't find the answer...

I want to make every other row in my table a different row. I can't
seem to find a way to do this through my Page_Load event like I
thought I would because I can't grab the table object. The table has
an ID so I don't see why I can't reference it in my event. Can
anyone shed some light on how to go about this. Oh, I'm new to
ASP.NET but do VB.NET often, so I may be missing some simple ASP
concept...

Thank
Chris


Did you add the runat="server" attribute?
After that, you can reference your table (it will take the type of
HtmlTable). Use the Rows property to address the different
rows.

--

Jos Branders

Nov 18 '05 #8

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

Similar topics

9
by: Jon Brunson | last post by:
Is it possible to use a DataAdapter to fill a DataTable, change the DataColumns of that DataTable (and maybe even it's name) and then commit those changes to the database (in my case SQL Server...
24
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two...
31
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...
5
by: David Deacon | last post by:
Hi i was given the following advise,below my OriginalQuestion I am a little new to ADOX can you direct me to the following Do i place the code behind a button on a form? Or do i place it in the...
2
by: ColinWard | last post by:
Hi. I have a form which has as its recordsource an SQL string. The SQL String is as follows: SELECT * from CONTACTS where false. this ensures that there is no data loaded in the form when the...
3
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the...
3
by: sparks | last post by:
I was copying fields from one table to another. IF the var name starts with milk I change it to egg and create it in the destination table. It works fine but I want to copy the description as...
1
by: Amos | last post by:
Can I add a column to the datagrid and also resize it? I add them like this: DataTableAddress.Columns.Add("Col1", typeof(string)); DataTableAddress.Columns.Add("Col2", typeof(string));...
1
by: mplus_2000 | last post by:
I have recently inherited a database. The switchboard (and other forms) displays the name of the database on it (top, center). Currently the name that appears is Reviews. There are plans to roll...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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

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.