Sending html page values to ASP page

Discussion in 'ASP .Net' started by Mark, Apr 21, 2008.

  1. Mark

    Mark Guest

    Hi Gurus,
    I am pretty new in ASP.net, so please help me solve a problem.
    We have many HTML pages which we do not want to change.

    What we want is on a button press it should goto a ASP page with all the
    values.

    I'll appreciate if I get some source example which I can try.

    Please help me.
    Mark
    Mark, Apr 21, 2008
    #1
    1. Advertising

  2. What you are describing is a simple FORM post. As long as all the "values"
    are inside the FORM tags, they will be posted to the target pages. And be
    careful using the term "ASP" - that means classic ASP, this is for ASP.NET.
    -- Peter
    To be a success, arm yourself with the tools you need and learn how to use
    them.

    Site: http://www.eggheadcafe.com
    http://petesbloggerama.blogspot.com
    http://ittyurl.net


    "Mark" wrote:

    > Hi Gurus,
    > I am pretty new in ASP.net, so please help me solve a problem.
    > We have many HTML pages which we do not want to change.
    >
    > What we want is on a button press it should goto a ASP page with all the
    > values.
    >
    > I'll appreciate if I get some source example which I can try.
    >
    > Please help me.
    > Mark
    >
    >
    >
    Peter Bromberg [C# MVP], Apr 21, 2008
    #2
    1. Advertising

  3. Mark

    Mark Guest

    Thanks for your reply.
    I have created an test example to clarify.

    On this form I have one input textbox and one Submit button. On submit I
    want to process the data(Text1) in Validate.aspx.vb.
    <form action ="../Validate.aspx" method ="post" >
    <input id="Text1" type="text" /><br />
    <br />
    <input id="Submit1" type="submit" value="submit" />
    </form>
    </body>

    But when code reaches Validate Page_Load event, then Request.Form.Count
    returns 0, when I am expecting Text1 value.

    Public Partial Class Validate
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    If Request.Form.Count > 0 Then
    Me.TextBox1.Text = Request.Form("Text1")
    End If
    End Sub
    End Class

    Tell me what am I doing wrong.
    Thanks, Mark



    "Mark Rae [MVP]" <> wrote in message
    news:Olso5q%...
    > "Mark" <> wrote in message
    > news:O0cEIX%...
    >
    >> We have many HTML pages which we do not want to change.
    >>
    >> What we want is on a button press it should goto a ASP page with all the
    >> values.

    >
    > Can you clarify please:
    >
    > 1) Where is this button?
    >
    > 2) When you say an ASP page, do you actually mean an ASP.NET page? They're
    > very different...
    >
    > 3) What do you mean by "all the values"?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    Mark, Apr 21, 2008
    #3
  4. Mark

    Mark Guest

    Guys,
    It started working when I replaced ID with Name.
    <input NAME="Text1" type="text" />

    Thanks guys for your help.
    Mark


    "Mark" <> wrote in message
    news:%23IcWDD$...
    > Thanks for your reply.
    > I have created an test example to clarify.
    >
    > On this form I have one input textbox and one Submit button. On submit I
    > want to process the data(Text1) in Validate.aspx.vb.
    > <form action ="../Validate.aspx" method ="post" >
    > <input id="Text1" type="text" /><br />
    > <br />
    > <input id="Submit1" type="submit" value="submit" />
    > </form>
    > </body>
    >
    > But when code reaches Validate Page_Load event, then Request.Form.Count
    > returns 0, when I am expecting Text1 value.
    >
    > Public Partial Class Validate
    > Inherits System.Web.UI.Page
    >
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > If Request.Form.Count > 0 Then
    > Me.TextBox1.Text = Request.Form("Text1")
    > End If
    > End Sub
    > End Class
    >
    > Tell me what am I doing wrong.
    > Thanks, Mark
    >
    >
    >
    > "Mark Rae [MVP]" <> wrote in message
    > news:Olso5q%...
    >> "Mark" <> wrote in message
    >> news:O0cEIX%...
    >>
    >>> We have many HTML pages which we do not want to change.
    >>>
    >>> What we want is on a button press it should goto a ASP page with all the
    >>> values.

    >>
    >> Can you clarify please:
    >>
    >> 1) Where is this button?
    >>
    >> 2) When you say an ASP page, do you actually mean an ASP.NET page?
    >> They're very different...
    >>
    >> 3) What do you mean by "all the values"?
    >>
    >>
    >> --
    >> Mark Rae
    >> ASP.NET MVP
    >> http://www.markrae.net

    >
    >
    Mark, Apr 21, 2008
    #4
    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. Marcelo
    Replies:
    2
    Views:
    2,936
    Frank Grassens
    Jan 22, 2004
  2. Jukka K. Korpela
    Replies:
    1
    Views:
    1,119
    Jonathan N. Little
    Sep 12, 2006
  3. Replies:
    0
    Views:
    1,351
  4. Luke
    Replies:
    2
    Views:
    4,697
    Nigel Wade
    Mar 15, 2007
  5. Chuck
    Replies:
    0
    Views:
    253
    Chuck
    Jul 5, 2003
Loading...

Share This Page