Mobile IE6 Standard ASP. NET-onblur not working for, problems with getAttribute

Source: Internet
Author: User

Source: http://www.imcoder.org/mobile/210544.htm

 

Q:

Hi all,

I have a simple ASP. NET 2 page with a TextBox control, in the PreRender I set ClientSide events :-

Response. Attributes. Add ("onchange", "javascript: alert ('changed ');");
Response. Attributes. Add ("onfocus", "javascript: alert ('has focal ');");
Response. Attributes. Add ("onblur", "javascript: alert ('lost focal ');");

In the destop browser everything is fine, all events fire as expected.

When I open the same page from a PDA running Mobile Windows Professional 6, only
Onfocus and onchange events fire, onblur never does.

The Internet Explorer Mobile Reference page tells me that these, and only these events can be caught in the mobile browser but I can't make it work.

RadioButton controls appear to work as expected for all three events-have had a chance to test the other controls yet.

 

I can see that the attribute is appearing in the tag (using the getAttribute method) and the attached script looks fine.

 

There also appears to be a problem with the getAttribute command in general.

According to the Internet Explorer Mobile Reference the method shocould return a null if the attribute is not found, instead an exception is thrown, but without any details attached to the error object.

Here's the JS function that I'm using to check :-

Function findAttributes (control ){
Try {
Alert ('in findAttributes ');
// Alert ('onfocus = '+ control. getAttribute ('onfocus '));
Alert ('onblur = '+ control. getAttribute ('onblur '));
Alert ('About to get wrongattribute ');
Var attrib = control. getAttribute ('wrongattribute ');
Alert ('maid ');
// If (control. getAttribute ('rongattrigger') = null ){
// Alert ('attribute not found ');
//}
// Else
//{
// Alert ('wrongattribute = '+ control. getAttribute ('wrongattribute '));
//}

ControlCurrent = control;
If (control. type = 'text ')
{
Alert ('this is a text control ');
}
Else
{
Alert ('this is NOT a text control ');
}
}
Catch (e ){
Catch (e ){
Alert ('error-'+ e. description );
Alert ('error-'+ e. message );
Alert ('error-'+ e. name );
Alert ('error-'+ e. number );
Alert ('error-'+ e. toString ());
}
}

Any help greatly appreciated.

 

Cheers,

 

Duncan

A:

Hello Spence,

It wocould be interesting to read something about the onblur issue from the IEMobile team.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.