Submit not returning to the server

Discussion in 'ASP .Net' started by Deidre, Aug 11, 2004.

  1. Deidre

    Deidre Guest

    I am having a weird problem. I have an application thats default.aspx
    page is a menu page when a menu item is selected the requested page is
    loaded into default.aspx using iframes. When unsaved changes have been
    made to the iframe page and a user selects another item from the
    default.aspx menu I want to prompt the user to see if they want to
    save changes before going to the selected page.
    The problem I am having is that the client form submit call is not
    causing the server to be called - unless I put a message box after the
    submit. I don't need this message box here but if I remove it the
    iframe changes to the selected page without saving the change even if
    the use selected to save changes.
    Here is the code I am using:
    Default.aspx - Client Code
    Function MenuHome() 'note this function is called by the onclick event
    of the menu item
    Dim sSource
    sSource = "home.aspx?" & _
    "ContactId=" & mlContactId & _
    "&FirstName=" & msContactFirstName & _
    "&LastName=" & msContactLastName & _
    "&UserLevel=" & miUserLevel & _
    "&NetUserId=" & msNetUserId & _
    "&UserType=" & msUserType

    If mbDirty Then
    'save changes first before proceeding to selected menu
    If InStr(1, iframe.location, "ActionStep.aspx") > 0 Then
    iMsgboxResult = MsgBox(PENDING_CHANGES, vbYesNoCancel +
    vbQuestion, "Action Step")
    If iMsgboxResult = vbYes Then
    'call the savechanges of the loaded page
    iframe.SaveChanges
    MenuClick(sSource)
    ElseIf iMsgboxResult = vbNo Then
    MenuClick(sSource)
    ElseIf imsgboxresult = vbCancel Then
    'do nothing
    End If
    Else
    MenuClick(sSource)
    End If
    Else
    'go the selected menu
    MenuClick(sSource)
    End if
    End Function

    Function MenuClick(sDest)
    f.src = sDest
    End If
    End Function
    Iframe page -Client Code
    Function SaveChanges()
    document.frmActionStep.action = document.frmActionStep.action &
    "&Save=Y"
    document.frmActionStep.submit
    msgbox "Temp Saved" 'note this is what makes it work ???
    End Function
    Iframe page - Server Code
    Page_Load
    If Request.QueryString("Save") = "Y" Then
    miSaveSuccess = IIf(SaveRecord(), 1, 0) 'note SaveRecord is the
    function that actually saves the changes to the database.
    Return
    End If

    Any help would be greatly appreciated.
    Thanks in advance,
    Deidre
     
    Deidre, Aug 11, 2004
    #1
    1. Advertising

  2. Deidre

    Deidre Guest

    I am still having problem with this. It's driving me crazy!
    It also working most of the time if I do 3 form submits one right
    after the other. It seems to be a timing thing but I don't think there
    is a function in vbscript like the vb function DoEvents. Is there?
    Thanks,
    Deidre
     
    Deidre, Aug 16, 2004
    #2
    1. Advertising

  3. Deidre

    Deidre Guest

    I adding this after the submit and it fixed the problem:
    start = timer : while timer-start < .2 : wend
    I tried several other things but this was the only thing that seemed to work.
    Deidre
     
    Deidre, Aug 19, 2004
    #3
    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. Megha Vishwanath
    Replies:
    2
    Views:
    9,843
    tutorialsmaster
    Oct 2, 2009
  2. Guest
    Replies:
    2
    Views:
    1,601
    Guest
    Oct 25, 2004
  3. Wim Roffal

    Submit or not submit

    Wim Roffal, Nov 22, 2003, in forum: Javascript
    Replies:
    6
    Views:
    242
    Janwillem Borleffs
    Nov 22, 2003
  4. Megha Vishwanath
    Replies:
    3
    Views:
    717
    Megha Vishwanath
    Jul 20, 2004
  5. Replies:
    3
    Views:
    699
Loading...

Share This Page