473,804 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1418
is it a <table...>
or <asp:Table... >
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQu otepro.com> wrote in message
news:ua******** ******@TK2MSFTN GP10.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_da rkfalz.com> wrote in message
news:OC******** ******@tk2msftn gp13.phx.gbl...
is it a <table...>
or <asp:Table... >
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQu otepro.com> wrote in message
news:ua******** ******@TK2MSFTN GP10.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.Attri butes["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@NoSpamzieQu otepro.com> wrote in message
news:Ox******** ******@TK2MSFTN GP09.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_da rkfalz.com> wrote in message
news:OC******** ******@tk2msftn gp13.phx.gbl...
is it a <table...>
or <asp:Table... >
?
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Chris" <cf@NoSpamzieQu otepro.com> wrote in message
news:ua******** ******@TK2MSFTN GP10.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).Co ntrols(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******** ********@TK2MSF TNGP12.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@NoSpamzieQu otepro.com> wrote in message
news:OF******** ******@TK2MSFTN GP12.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).Co ntrols(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******** ********@TK2MSF TNGP12.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******** ********@TK2MSF TNGP12.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
10914
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 2000)? Eg: Dim dc As New SqlCommand("SELECT TOP 0 * FROM SomeTable", SomeSqlConnection)
24
3536
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 frames have been loaded by using a javascript statement from the "navigation" frame, as shown below: top.window.ccs_logo.src = 'images/ccs_logo.gif'; alert(top.window.ccs_logo.src);
31
5730
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...
5
2483
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 On Open event and have a the default 10% and give the user the option to change it to 0% I have referenced th appropriate library and the default value of the field to change is 0.1
2
2632
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 form is opened. After the user selects the contact from an unbound combobox I want the form to be rebound to its recordsource. I tried using form.recordsource = "Contacts" in the afterupdate event of
3
4595
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 report has started printing the properties can't be changed. It can be done with an MDB by opening it in design mode hidden, making the change, saving it and then opening it in preview mode. However, this obviously doesn't work in an MDE which...
3
2576
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 well. Short version :) For Each fld In tdf.Fields pos = InStr(fld.Name, "milk") If pos > 0 Then
1
3262
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)); DataTableAddress.Columns.Add("Col3", typeof(string)); I'd like to add to resize them without using a datacolumn because there's over 30 columns and because the application is working well already (I don't know how the datacolumn additions will affect the...
1
2686
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 out the application (i.e. making copies of the database) to other locations (Reviews-NY, Review-Dallas etc). If was mentioned today in passing by the original developer that there is a way to change the title that appears on the switchboard without...
0
10337
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
10323
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
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
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 project—planning, coding, testing, and deployment—without 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...
0
6854
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
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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
3822
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.