locked
Mobile Command Button Problems RRS feed

  • Question

  • User876223366 posted
    Hi,

    I am new to the forum and new to Mobile Web Development. I have developed a mobile application and deployed it on my server. The application requires a pin number in order to log in the site. After you login you can browse through some pages (mobile pages). I have tested my appliaction on my mobile phone (NOKIA 7250i) and on the Openwave Simulator 7 and it works fine. I also tested it with OpenWave 6 and Sony-Ericsson K700 and it does not work.

    The problem is that whenever i enter the correct pin, it always redirects me to the login screen. I do not use cookies, yet i have this problem.

    Today i figured out that the code is correct becuase, even if i try to make a simple command (display some text in a label), the command does not execute. There is a problem with the command button.

    Does anyone know how to overcome this problem as i am stuck FOR DAYS.

    Any help will be appreciated.
    Friday, July 15, 2005 10:47 AM

All replies

  • User-95607119 posted
    Can you show your source code and template and output that OpenWave emulator generates for SE K700?
    Friday, July 15, 2005 12:03 PM
  • User876223366 posted

    Below is my code:

    Web.Config:
    -------------------

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
       
      <system.web>

        <!--  DYNAMIC DEBUG COMPILATION
              Set compilation debug="true" to insert debugging symbols (.pdb information)
              into the compiled page. Because this creates a larger file that executes
              more slowly, you should set this value to true only when debugging and to
              false at all other times. For more information, refer to the documentation about
              debugging ASP.NET files.
        -->
        <compilation defaultLanguage="vb" debug="true" />

        <!--  CUSTOM ERROR MESSAGES
              Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
              Add <error> tags for each of the errors you want to handle.

              "On" Always display custom (friendly) messages.
              "Off" Always display detailed ASP.NET error information.
              "RemoteOnly" Display custom (friendly) messages only to users not running
               on the local Web server. This setting is recommended for security purposes, so
               that you do not display application detail information to remote clients.
        -->
        <customErrors mode="RemoteOnly" />

        <!--  AUTHENTICATION
              This section sets the authentication policies of the application. Possible modes are "Windows",
              "Forms", "Passport" and "None"

              "None" No authentication is performed.
              "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
               its settings for the application. Anonymous access must be disabled in IIS.
              "Forms" You provide a custom form (Web page) for users to enter their credentials, and then
               you authenticate them in your application. A user credential token is stored in a cookie.
              "Passport" Authentication is performed via a centralized authentication service provided
               by Microsoft that offers a single logon and core profile services for member sites.
        -->
      
    <authentication mode="Forms">
       <forms loginUrl="Login.aspx" protection="All"
       timeout="60" path="/">
          </forms>
    </authentication>

        <!--  AUTHORIZATION
              This section sets the authorization policies of the application. You can allow or deny access
              to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
              (unauthenticated) users.
        -->
        <authorization>
            <deny users="?"/> <!-- Allow all users -->

                <!--  <allow     users="[comma separated list of users]"
                                 roles="[comma separated list of roles]"/>
                      <deny      users="[comma separated list of users]"
                                 roles="[comma separated list of roles]"/>
                -->
        </authorization>

        <!--  APPLICATION-LEVEL TRACE LOGGING
              Application-level tracing enables trace log output for every page within an application.
              Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
              trace information will be displayed at the bottom of each page.  Otherwise, you can view the
              application trace log by browsing the "trace.axd" page from your web application
              root.
        -->
        <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

        <!--  SESSION STATE SETTINGS
              By default ASP.NET uses cookies to identify which requests belong to a particular session.
              If cookies are not available, a session can be tracked by adding a session identifier to the URL.
              To enable cookies, set sessionState cookieless="false".
        -->
        <sessionState
                mode="InProc"
                stateConnectionString="tcpip=127.0.0.1:42424"
         sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
                cookieless="true"
                timeout="20"
        />

        <!--  GLOBALIZATION
              This section sets the globalization settings of the application.
        -->
        <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
     
        <!-- FULLY QUALIFY URL FOR CLIENT REDIRECTS
              Some mobile devices require that the URL for client redirects be fully qualified.
        -->
        <httpRuntime
                useFullyQualifiedRedirectUrl="true"
        />

     <!-- SPECIFY COOKIELESS DATA DICTIONARY TYPE
         This will cause the dictionary contents to appear in the local request url querystring.
         This is required for forms authentication to work on cookieless devices.
        -->
       
    <mobileControls
          cookielessDataDictionaryType="">
              
       </mobileControls>

     
        <deviceFilters>
      <filter name="isJPhone" compare="Type" argument="J-Phone" />
      <filter name="isHTML32" compare="PreferredRenderingType" argument="html32" />
      <filter name="isWML11" compare="PreferredRenderingType" argument="wml11" />
      <filter name="isCHTML10" compare="PreferredRenderingType" argument="chtml10" />
      <filter name="isGoAmerica" compare="Browser" argument="Go.Web" />
      <filter name="isMME" compare="Browser" argument="Microsoft Mobile Explorer" />
      <filter name="isMyPalm" compare="Browser" argument="MyPalm" />
      <filter name="isPocketIE" compare="Browser" argument="Pocket IE" />
      <filter name="isUP3x" compare="Type" argument="Phone.com 3.x Browser" />
      <filter name="isUP4x" compare="Type" argument="Phone.com 4.x Browser" />
      <filter name="isEricssonR380" compare="Type" argument="Ericsson R380" />
      <filter name="isNokia7110" compare="Type" argument="Nokia 7110" />
      <filter name="prefersGIF" compare="PreferredImageMIME" argument="image/gif" />
      <filter name="prefersWBMP" compare="PreferredImageMIME" argument="image/vnd.wap.wbmp" />
      <filter name="supportsColor" compare="IsColor" argument="true" />
      <filter name="supportsCookies" compare="Cookies" argument="true" />
      <filter name="supportsJavaScript" compare="Javascript" argument="true" />
      <filter name="supportsVoiceCalls" compare="CanInitiateVoiceCall" argument="true" />
        </deviceFilters>
     
      </system.web>

    </configuration>


    Login.aspx
    --------------------------

    <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb" Inherits="System.Web.UI.MobileControls.MobilePage" %>
    <%@ Import Namespace="System.Web.Mobile" %>
    <%@ Import Namespace="System.Web.Security" %>
    <SCRIPT language="vb" id="Script1" runat="server">

    Sub LoginBtn_Click(sender As Object, e As EventArgs)

    Dim MySessionId As String
    'MySessionId = Session.SessionID
    'me.Label2.text = MySessionId

    If (me.CodeTxb.Text = "1234") Then
          
            MobileFormsAuthentication.RedirectFromLoginPage(ME.CodeTxb.Text, False)
               
    else

     me.Label2.visible = true

    End If


    End Sub

    </SCRIPT>
    <MOBILE:FORM id="formA" runat="server" Paginate="True">
     <mobile:Label id="Label2" runat="server" Font-Size="Small" ForeColor="Red">You have specified an invalid code.</mobile:Label>
     <mobile:Label id="LoginLbl" runat="server" Font-Size="Small">Please enter your 8-digit code.</mobile:Label>
     <Mobile:TextBox id="CodeTxb" runat="Server" Password="True"></Mobile:TextBox>
     <Mobile:Command id="LoginBtn" onclick="LoginBtn_Click" runat="Server" SoftkeyLabel="go">Login</Mobile:Command>
    </MOBILE:FORM>


    Default.aspx
    -----------------


    <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Default.aspx.vb" Inherits="System.Web.UI.MobileControls.MobilePage" %>
    <%@ Import Namespace="System.Web.Mobile" %>
    <%@ Import Namespace="System.Web.Security" %>
    <HEAD>
     <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
     <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
     <meta name="vs_targetSchema" content="http://schemas.microsoft.com/Mobile/Page">
    </HEAD>
    <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
     <mobile:Form id="Form1" runat="server">
      <mobile:Link id="Link1" runat="server" NavigateUrl="Poly.aspx">1. Poly Tones</mobile:Link>
      <BR>
      <mobile:Link id="Link2" runat="server">2. Wallpapers</mobile:Link>
      <BR>
      <mobile:Link id="Link3" runat="server">3. Mono Tones</mobile:Link>
      <BR>
      <mobile:Link id="Link4" runat="server">4. Java Games</mobile:Link>
      <BR>
      <mobile:Link id="Link5" runat="server">5. Logos</mobile:Link>
      <BR>
      <mobile:Link id="Link6" runat="server">6. Pic Messages</mobile:Link>
      <BR>
      <mobile:Link id="Link7" runat="server">7. Color Animations</mobile:Link>
      <BR>
      <mobile:Link id="Link8" runat="server">8. Mono Chart</mobile:Link>
     </mobile:Form>
    </body>


    Saturday, July 16, 2005 5:28 AM
  • User876223366 posted

    Please note that i do not want to use cookies because not all mobile phones support cookies.

     

    Can someone please help me?

    Saturday, July 16, 2005 9:39 AM
  • User286710293 posted
    because not all mobile phones support cookies.So you do not use
    <authentication mode="Forms">
    Sunday, July 17, 2005 2:30 AM
  • User876223366 posted
    what should i use? Can someone help me please??

    Point me to some sample code?
    Sunday, July 17, 2005 11:01 AM
  • User-95607119 posted
    Instead of forms authentication use your own authentication mechanisms. On a point of changing permissions - forms authentication is ... hmm... not a good solution. What if you have one day 100.00 users? Do you register all of them to web.config? I think you don't. Every file save of web.config means application restart.... So... [:)]
    Sunday, July 17, 2005 7:48 PM