How to nevigate to tagert page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • john20
    New Member
    • Jul 2008
    • 37

    #1

    How to nevigate to tagert page

    Hi All,

    I have created the form and html controls dynamically in the page load method of
    the page.

    Like below :

    Code:
    Dim form As New HtmlForm
    Dim btnSubmit As New HtmlInputButton
    Dim txtQuery As New HtmlInputText form.Action = "User.aspx"
    form.Method = "POST"
    form.Name = "form1"
    
    txtQuery.Name = "user"
    txtQuery.Value = "john"
    
    btnSubmit.ID = "Submit"
    form.Controls.Add(txtQuery)
    form.Controls.Add(btnSubmit)

    what I want is that without clikcing on the submit button it should navigate to
    the target page which is listed in the Action and post the data as well.

    how can I achive this by programatically .
    Please note I have a requirment to use this mechanism.

    Thanks in Advance
    John
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Are you using ASP.NET?
    In ASP.NET you shouldn't be dynamically adding a Form to the page...it's already there by default.

    -Frinny

    Comment

    Working...