I have a COM Object whose methods i can call in a HTML page using the code .But when i use the same code in an aspx page with a Master Page and keep the object in ContentPlaceHolder tag i get the error MyObject is undefined
My Javascript is:
function setText()
{
txtIdCardNo.value = MyObject.getIdCard;
if (MyObject.getIdType() == "R") {
rdbCardType2.checked = true;
}
else {
rdbCardType.checked = true;
}
txtCardExpiryDate.value = MyObject.getCardexpirydate();
txtNameEnglish.value = MyObject.getNameEnglish();
txtNameArabic.value = MyObject.getNameArabic();
if (MyObject.getGender() == "M") {
rdbMale.checked = true;
} else {
rdbFemale.checked = true;
}
TxtDob.value = MyObject.getDob();
txtNationality.value = MyObject.getNationality();
txtSponsorName.value = MyObject.getSponsorEng();
txtSponsorNameArabic.value = MyObject.getSponsorArb();
txtBirthPlace.value=MyObject.getBirthPlace();
txtPassportExpiry.value = MyObject.getPassport();
txtPassportNo.value = MyObject.getPassportexp();
txtSmartCardId.value = MyObject.getSmartCard();
txtSamCardId.value = MyObject.getSAMCard();
}
My Html Object is
<object id="MyObject" name="MyObject"
classid="clsid:37123a95-5afb-4f68-b95b-b735c505d8d9"></object>
This is not a solution to the problem but an alternate route that is by using ActiveXObject we can access the COM Object in our javascript ,in which case we dont have to use HTML Object