Wednesday, August 02, 2006

<tagname> - egy post-ban

Az előbbi post-nál nagy gondban voltam, mert a <tagname>-t nem szövegként kezelte le ez a szerkesztő, hanem html/xml tagként, így eltűnt. Ezért gondoltam, hogy felteszek ide egy listát a kódokkal, hogy máskor ne kelljen Google-ezzek ilyesmi miatt.

< = & l t ;
> = & g t ;

P.S. a kódokat nyilván szóköz nélkül kell használni.

HTC


A HTC file is nothing but an HTML file, saved with a .htc extension. It contains scripts and a set of HTC-specific custom elements, that define the component.

Objects:
document - the HTML document in a given browser window
PUBLIC: ATTACH - binds a function to an event
PUBLIC: COMPONENT - identifies the content of the file as HTC
PUBLIC: DEFAULTS - sets default properties for an HTC
PUBLIC: EVENT - defines an event
PUBLIC: METHOD - defines a method
PUBLIC: PROPERTY - defines a property of the HTC
element - returns a reference to the tag in the primary document, to which the behavior is attached

exp.
attaching behavior to a simple asp TextBox:
TextBox _myTextBox;
...
_myTextBox.Style.Add("behavior","url(myhtcfile.htc)");

where the HTC file should look like this:
<PUBLIC: COMPONENT>
<PUBLIC: PROPERTY name="propertyName" />
<PUBLIC: ATTACH event="eventName" handler="MyEventHandler"/>
...
<SCRIPT language="JScript">
function MyEventHandler()
{ ... }
</SCRIPT>
</PUBLIC: COMPONENT>

and the file name should be:
myhtcfile.htc