Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 05-29-2009, 09:28 AM
  #1
kleindahl
Aspirant (Level 2)
 
Join Date: Jun 2008
Posts: 12
iTrader: (0)
kleindahl is an unknown quantity at this point
Altering html output from codebehind in C#

Hi,

i have a horizontal css menu with a dropline. I need to change css class on <ul> and anchors for active menu items.

I want to do this from code behind so that i don't rely on javascript.

My problem is to find an effective way to search through the html and find the correct dom items that match variables from the querystring, and then alter them.

Can anybody help me in the right direction?

/ Christian
kleindahl is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-03-2009, 08:41 AM
  #2
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
MenuItemClick Event; and e.CssClass = "myClass";
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-10-2009, 09:55 AM
  #3
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
To be able to use code behind, it is better to use server side controls instead of html controls. You will not have to search through html if you are using server side controls. You will be able to access each items by index when using them.
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-10-2009, 04:31 PM
  #4
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
the HTML Controls that have Runat="server" work just as well...

You can access them by index or by name either way...
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-11-2009, 05:01 PM
  #5
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
Quote:
Originally Posted by afterburn View Post
the HTML Controls that have Runat="server" work just as well...

You can access them by index or by name either way...
To use as in your previous post, doesnt it have to be a server control, like "MenuItemClick Event; and e.CssClass = "myClass";" I am not a master of ASP.net and hence this query...
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-14-2009, 09:50 AM
  #6
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
There are multiple types of controls. User Controls which can be a DHTML/ajax or just a complete Form with textboxes and drop downs on it.

HTML Controls that are grouped on the toolbox and Server Controls which are .net wrapped controls. The HTML Controls give you access to some of the properties but have some limitations vs Server Controls; It Table vs HtmlTable both result in an Table being rendered but one is wrapped for propeties and events in the .net framework
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 03:29 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.