locked
Dynamically generated MobileForm does not work in IE RRS feed

  • Question

  • User68261763 posted

    HI,

    I'm trying to dynamically generate mobile forms (which I think equate to cards in a WML deck).  I need them to be dynamic - I'm iterating thru a DataTable and creating a Mobile Form for each row.  It works fine on my Blackberry (Browser in WAP emulation mode), but in IE, I get an error when I click on my link button to go to the next card:

    Server Error in '/FlightLogs' Application.

    Page must contain at least one Form.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Exception: Page must contain at least one Form.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [Exception: Page must contain at least one Form.]
       System.Web.UI.MobileControls.MobilePage.get_ActiveForm() +622878
       System.Web.UI.MobileControls.MobilePage.SavePageStateToPersistenceMedium(Object view) +474
       System.Web.UI.Page.SaveAllState() +552
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1676
    

     

    Again, once I publish and try it on the BB, it works, but I'd like it to work in IE so I can test/degub from the development environment.  When I use static Mobile Forms (dragged from the toolbox), everything works in IE and on the BB. 

    Can someone PLEASE tell me why my dynamically generated forms don't behave like the static controls when I run the application in IE???

    Here is my code:

    Sub LoadForms()

    Dim objLegsAdapter As New FlightLogsTableAdapters.spFL_LegByDateACTableAdapter

    Dim objLegsTable As FlightLogs.spFL_LegByDateACDataTable

    Dim objLegsRow As FlightLogs.spFL_LegByDateACRow

    Dim intX As Int16 = 0

    objLegsTable = objLegsAdapter.GetData(p_dteDate, p_intAC)

    For Each objLegsRow In objLegsTable.Rows

    intX += 1

    Dim objForm As New MobileControls.Form

    Dim objControl As New MobileControls.Label

    Dim objLink As New MobileControls.Link

    With objControl

    .Text = objLegsRow.orgid

    objForm.Controls.Add(objControl)

    End With

    With objLink

    If intX < objLegsTable.Rows.Count Then

    .ID = "Link" & intX

    .NavigateUrl = "#Form" & intX + 1

    .Text = "Next Page"

    .SoftkeyLabel = "Next Page"

    objForm.Controls.Add(objLink)

    End If

    End With

    objForm.ID = "Form" & intX

    Me.Controls.Add(objForm)

    Next

    objLegsTable = Nothing

    objLegsAdapter = Nothing

    End Sub

    Thursday, March 8, 2007 12:04 PM

All replies

  • User-1179442337 posted

    hiya im not exact sure what yr asking , but IE doesnt know what cards are. it doesnt know what wml is.

    wml and cards = for wap 1.0 devices. me myself, if i was making a dynamic site for mobiles, i wouldn use cards as wap 1.0 is quikly

    becoming a thing of the past. most mobile phones nowdays use wap2.0 which is near equivelent to XHTML and/or HTML.

    wml cards were designed so that a mobile phone could load up several pages(cards) at once(deck). but this is no longer needed today as we have faster internet connections for mobile devices. also turn off all caching for dynamic content.

    hope this helps.

    Wednesday, March 14, 2007 1:39 PM