#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    32
    Rep Power
    5

    Posting Form From Aspx.vb to Asp


    I'm creating a dynamic form in javascript on an aspx.vb file using clientstartupscript.

    I just can't get it to submit/post to the asp page from aspx.vb

    The asp page expects to get the variables from the form object. request.form("1")

    I am creating a form, with a input type and name/id of "1"... but its just not submitting.

    Fiddler is throwing me a 200 status, and I'm not getting any errors.
    It just won't go to the page!

    I tried... creating a normal html page and using this exact dynamic form and i tried to manually post to asp and it worked as a sample!.. but from aspx.. something is not right!

    Please help. See Code Below:
    startpage.aspx.vb
    Code:
                "var f = document.createElement('form'); " & _
                "var r = document.createElement('input'); " & _
                "r.type = 'hidden'; " & _
                "r.name = '1'; " & _
                "r.value = " + rid + "; " & _
                "f.appendChild(r); " & _
                "var mq = document.createElement('input'); " & _
                "mq.type = 'hidden'; " & _
                "mq.name = '3'; " & _
                "mq.value = " + qtotal + "; " & _
                "f.method = 'POST'; " & _
                "f.action = 'targetpage.asp'; " & _
                "alert('Submitting to SelExit'); " & _
                "f.submit(); " 
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "ClientScript", javstring, True)
    end page/ target page .asp
    Code:
    request.form("1")
    request.form("3")
    It got to the submitted to selexit alert box, but then went no where, just got stuck in the start page. blank screen.. no errors.. whathef
    Last edited by stillblazin; January 12th, 2012 at 01:27 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    32
    Rep Power
    5
    This is resolved.. I had to have a dummy form in the aspx page..
    as well for this to work.. so weird. This dummy form has the action attribute set.. and runat = server, not sure if those are required but its working!

IMN logo majestic logo threadwatch logo seochat tools logo