Page not found with mobile application..

Discussion in 'ASP .Net Mobile' started by mihabib@gmail.com, Jun 14, 2008.

  1. Guest

    I have a very simple mobile app that has a text box and object list.
    Apps seems to be working OK, however time to time when we try to go
    back from details page, it takes to:

    The page cannot be found

    The page you are looking for might have been removed, had its name
    changed, or is temporarily unavailable.

    If we start search again, it works OK for few times until dies again.

    Following is the code. Any help with be appreciated.

    Imports System.Data
    Imports System.Data.Sql
    Imports System.Data.SqlClient

    Partial Class _Default

    Inherits System.Web.UI.MobileControls.MobilePage
    Private objCnn As New
    SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("cnnAMP_DEV"))

    'splits the domain\user and returns the user
    Private Function RequestLogon_User() As String

    Dim LogonId As String() =
    Request.ServerVariables("Logon_User").Split("\")
    Return LogonId(1)

    End Function

    'Protected Sub frmMain_Activate(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles frmMain.Activate
    ' lblWelcome.Text = "Welcome user: " + RequestLogon_User()
    'End Sub

    Private Function PermissionChecking(ByVal LogonID As String) As
    Boolean

    Dim objCmd As SqlCommand = New SqlCommand
    Dim objDR As SqlDataReader
    Dim bln As Boolean

    If Not (objCnn.State = ConnectionState.Open) Then
    objCnn.Open() '--dh

    With objCmd
    .CommandText = "Donor_Mobile_CheckPermission_ssp"
    .Connection = objCnn
    .CommandType = CommandType.StoredProcedure
    .Parameters.Add("@LogonId", SqlDbType.VarChar, 100).Value
    = RequestLogon_User()
    End With

    objDR =
    objCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
    objDR.Read()

    With objDR
    If .HasRows Then
    bln = .GetValue(0)
    'bln = .Item(0) Another way of checking the result.
    End If

    End With

    '--dh
    objDR.Close()
    If Not (objCnn.State = ConnectionState.Closed) Then
    objCnn.Close()

    Return bln

    End Function

    Private Sub Donor_Mobile_SearchList_Test_ssp()

    Dim objCmd As New SqlCommand
    Dim objDA As New SqlDataAdapter
    Dim objDS As New DataSet

    If Not (objCnn.State = ConnectionState.Open) Then
    objCnn.Open()

    With objCmd
    .CommandText = "Donor_Mobile_SearchList_Test_ssp"
    .Connection = objCnn
    .CommandType = CommandType.StoredProcedure
    .Parameters.Add("@SearchText", SqlDbType.VarChar,
    50).Value = txtSearch.Text

    objDA.SelectCommand = objCmd
    objDA.Fill(objDS, RTrim(txtSearch.Text))
    End With

    With objListUser
    .DataSource = objDS
    .TableFields = "LastName;FirstName"
    .DataBind()
    End With

    End Sub

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles btnSearch.Click

    If Len(txtSearch.Text) > 0 Then

    If PermissionChecking(RequestLogon_User) Then
    Donor_Mobile_SearchList_Test_ssp()

    Else
    Me.ActiveForm = frmDenied

    End If
    End If

    End Sub

    Protected Sub frmMain_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles frmMain.Load
    lblWelcome.Text = "Welcome user: " + RequestLogon_User()
    End Sub
    End Class
    , Jun 14, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Parker
    Replies:
    1
    Views:
    3,084
    Martin
    Jun 27, 2004
  2. Samy
    Replies:
    0
    Views:
    529
  3. Replies:
    3
    Views:
    542
  4. Trent Mick
    Replies:
    0
    Views:
    473
    Trent Mick
    Apr 3, 2008
  5. chen selina
    Replies:
    0
    Views:
    1,280
    chen selina
    Jul 13, 2010
Loading...

Share This Page