ASP.NET & Multi-Platform Environments

by Marcia Gulesian





Listing One



<!-- AppleWebKit Based Browsers (Safari...) //-->

  <case match="AppleWebKit/(?'version'(?'major'\d)

                                          (?'minor'\d+)(?'letters'\w*))">

    browser=AppleWebKit

    version=${version}

    majorversion=${major}

    minorversion=0.${minor}

    frames=true

    tables=true

    cookies=true

    javascript=true

    javaapplets=true

    ecmascriptversion=1.5

    w3cdomversion=1.0

    css1=true

    css2=true

    xml=true

    tagwriter=System.Web.UI.HtmlTextWriter

    <case match="AppleWebKit/(?'version'(?'major'\d)

                                        (?'minor'\d+)(?'letters'\w*))

                                        (\(KHTML, like Gecko\) )?

                                        (?'type'[^/\d]*)/.*$">

    type=${type}

    </case>

  </case>





Listing Two



<!-- Konqueror //-->

<case match = "Konqueror/(?'version'(?'major'\d+)

                         (?'minor'\.\d+)(?'letters'));\w*(?'platform'[^\)]*)">

browser=Konqueror

version=${version}

majorversion=${major}

minorversion=${minor}

platform=${platform}

type=Konqueror

frames=true

tables=true

cookies=true

javascript=true

javaapplets=true

ecmascriptversion=1.5

w3cdomversion=1.0

css1=true

css2=true

xml=true

tagwriter=System.Web.UI.HtmlTextWriter

</case>





Listing Three



function disableTextBox() { 

var selectElement = document.getElementById('ddlWhatever');

var len = selectElement.options.length;

for (var i= 0; i < len; i++){

var bln = selectElement.options[i].selected;

var val = selectElement.options[i].value;

if (bln == true){

if (val == 'ABC'){

document.Form1.TextBox1.disabled = true; 

                //  Works in I.E. (PC), Safari 1.0.2 & 1.2.2, and Konqueror

//document.Form1.TextBox1.readOnly = true;

                //  Works in I.E. (PC), Safari 1.2.2, and Konqueror

//document.getElementById("TextBox1").setAttribute("readOnly",true); 

//  Works only in I.E. (PC)

}

else{

document.Form1.TextBox1.disabled = true; 

            //  Works in I.E. (PC), Safari 1.0.2 & 1.2.2, and Konqueror

//document.Form1.TextBox1.readOnly = true; 

            //  Works in I.E. (PC), Safari 1.2.2, and Konqueror 

//document.getElementById("TextBox1").setAttribute("readOnly",true); 

            //  Works only in I.E. (PC)

}

} 

} 

}





Listing Four



function launchWindow() {       

if (document.getElementById("ddlWhatever").getAttribute("value") == 'ABC')

{

var dateWin;

dateWin = window.open("Page1.aspx",'');

dateWin.focus();

}

else

{

var dateWin;

dateWin = window.open("Page2.aspx",'');

dateWin.focus();

}

}



Listing Five



window.opener=self;

window.close();







1



