Last post Feb 22, 2010 06:11 PM by MGuser
Apr 09, 2007 12:36 PM|BongoBob|LINK
I have an app used on a Blackberry 8700 and need help figuring out how to close the app on the device. I have tried the following:
Apr 09, 2007 04:05 PM|bobbyz|LINK
The window.close works for me. How are you doing it?
Remember your btnExit need to be a regular webcontrol button. You need to put it inside the content template of a device context inside a panel. Then in your code (page load), you find this control and then add the onclick attribute. Only difference I have
dim btnExit as System.Web.UI.WebControls.Button
btnExit = FindControlInDeviceTemplate("btnExit", pnlExit)
if (Not btnExit is Nothing) Then
FindControlInDeviceTemplate is my utility function to find a given control by its ID in a given panel or form.
Apr 09, 2007 05:07 PM|BongoBob|LINK
Here is how the app works. The Home page is a regular aspx page and the EXIT button is on it. The app opens on the Blackberry to the Home page, whereupon the user clicks a button to go to the Mobile page, input their data and submit it. After submission,
the user has to go back to the Home page to select the EXIT button to exit and close the app.
Is your code example above supposed to be on a Mobile page? If so, I need to rephrase my question to "How can I make the EXIT button close the Blackberry application when the EXIT button is on a regular aspx page?" Does that make a difference on your response?
Thanks very much for your help.
Apr 09, 2007 06:22 PM|bobbyz|LINK
I am not following. Are you trying to close another app from your aspx page? I thought you were trying to close your running web browser when user clicks on the exit button. If it is an separate app or web page, then I don't know.
There is only minor difference if regular aspx page or the mobile aspx page. In regular aspx page, you don't need to use any device specific template nor do you need to find the control in a panel/form. Just use the ID of the control like you had in your
Apr 10, 2007 09:21 AM|BongoBob|LINK
I'll try to do a better job of explaining. I have a web application that is used on both a PC and a Blackberry. So I have regular aspx pages and mobile aspx pages in the application. After logging in, users (PC & Blackberry) are directed to the HOME page.
The HOME page just has a bunch of Buttons on it which redirect to various aspx pages (regular and mobile). One of those buttons on the HOME page is the EXIT button in question.
So users (PC & Blackberry) always return to the HOME page to log out of the application and close the browser (PC & Blackberry) via the EXIT button. The following code is in the Page_Load function of the HOME page:
If Session("Device") = "Desktop" Then
ElseIf Session("Device") = "Mobile" Then
btnExit is the EXIT button on the HOME page. The 'If' part works fine in closing the app & browser on the PC. The 'ElseIf' code, which executes if the user is using a Blackberry, is not working. That's my problem.
Hope this clarifies what is happening. Hope you can help.
Apr 10, 2007 11:48 AM|bobbyz|LINK
Feb 22, 2010 06:11 PM|MGuser|LINK
Did you find an answer to this.
I am having a similar problem. I have multiple buttons on my page and blackberry does not recognize the default button. It marks the first rendered button as the default button.