views:

1429

answers:

1

I've got a small little page that is going to be viewed from a BB. Here's my 2 questions:

  1. If I "click" on the link to submit the page, I get the following error: "JavaScript: An error occurred while executing a script." I can tell my BB to emulate a Microsoft IE browser and I don't get this error. I hope to not use this option because I doubt my users will be able to figure this out.

  2. I have a panel that has a text box and a button in it. I set the DefaultButton property of the panel to be the button so when someone hits the enter button, it fires the click event of the button. When I hit enter on my BB, it reloads the page. Does anyone know why and how to fix this?

Thanks

+2  A: 

Javascript support isn't great on the blackberry, especially BBs running older software.

For #1 your site is outputting two different sets of HTML. Setting the browser type only the blackberry doesn't affect its rendering engine at all, it just sends a different header that makes asp.net think the client is running IE and there for it is sending different html/javascript.

For #2 I don't think the BB is going to do what you want. It is submitting the form but not setting the event target correctly. It may be easier to move your form handing logic into Page_Load inside an isPostback if statement. that way no matter how the form is submitted your code will run.

Both cases may be fixed by giving more details about the blackberry browser to asp.net. Here is an article that describes how to make a .browser file so that asp.net knows what type of HTML and JavaScript to send to the device.

TonyB