help.net


Musing on .Net

News

Windows Phone Apps I recommend

FotoBank


FotoIreland



hit counters






Open source CMS


My blog

Irish blogs

Locations of visitors to this page Get Chitika eMiniMalls

.Net useful

Blogs I read

PocketPC

SQL

Usability

Setting Server Control Properties Based on Target Browser

You can set a different value for a property for IE than for Firefox - and for anything else. I didn't try all properties, but I did try many that would matter, such as Text and OnClientClick etc, and they do work. Take a look at the following markup:

<asp:Label runat="server" ID="labelText" 
ie:Text="This is IE text"
mozilla:Text="This is Firefox text"
Text="This is general text"
/>

<br />

<asp:Button runat="server" ID="buttonText"
ie:Text="IE Button"
ie:OnClientClick="javascript:alert('Hello IE!');"
mozilla:Text="FF Button"
mozilla:OnClientClick="javascript:alert('Hello Firefox!');"
Text="General Button"
OnClientClick="javascript:alert('Hello everyone else!');"
/>


Notice the "ie:" and "mozilla:" prefixes on the Text and OnClientClick properties.

Read more...

 

Posted: Sep 22 2008, 02:15 PM by help.net | with 1 comment(s)
Filed under:

Comments

No Comments