BPSoftware.com
Home   Utilities   Purchase   FAQ   Support   Contact        
Shareware Utilities
 APrintDirect
 AIconExtract
 AFile Attribute Manager
Freeware Utilities
 AddrMon
 AFileSync
 ASysIcon
 B&P Table Utilities
 BPACLer
 BPSNMPMon
 BPSNMPUtil
 CharCount
 Delphi® Components
 MacAddr
Miscellaneous
 BPSoftware Blog
 Purchase Shareware
 Support

 Subscribe!

Saturday, March 25, 2006
HTML Element

When developing an ASP.NET application with BDS® 2006 the Web Controls allow you to create code and control events to manage the flow of your application. The interaction with HTML elements via code is not as obvious, but is possible. Placing an HTML Div HTML Element on an ASP.NET Web Application page results in the following page code:
<div>Div</div>
Change the code to look something like:
<div runat="server" id="divarea"></div>
Declare a strict protected variable for your ‘divarea’ in your webform class. The variable name should match the id you give your element.
strict protected
divarea: System.Web.UI.HtmlControls.HtmlGenericControl;
Your HTML Element is now accessible in you codebehind page. You have access to the controls properties and can do something like the following in your code to change the text of the ‘divarea’:
divarea.InnerHtml:= ‘This is a HTML Div Element’;
Putting this together with the information in a previous post I created a ‘blogroll’ page that displays the most recent 5 posts from a few feeds I monitor. BDS® 2006 truly simplifies ASP.NET.

Labels: , ,

posted by Brad Prendergast at 8:01:00 AM
Comments:
Links to this post:

Create a Link

Recent Posts
 ARP! ARP!
 Rightly So
 Easy Does It
 Syndicate Me
 Around the network of silken thread
 I did not win
 Please Pick Me!
 CursorText
 A Few Good Shows
 MyOwnConversion

 Subscribe!


Labels



Archives
 October 2005
 November 2005
 December 2005
 January 2006
 February 2006
 March 2006
 April 2006
 May 2006
 June 2006
 July 2006
 August 2006
 September 2006
 December 2006
 January 2007
 February 2007
 March 2007
 September 2007
 October 2007
 November 2007
 July 2008
 November 2008
Powered by Blogger