save post data without session variable?

Discussion in 'ASP General' started by SLH, Oct 2, 2006.

  1. SLH

    SLH Guest

    i have an asp page with a form that posts to itself. (the action of the form
    is the same page the form is on). i validate input and dont accept it if
    there is something wrong with it. problem is that when the form is
    submitted, and i display the error message, the data the user typed in the
    box is gone. i work around this by setting a session variable as soon as the
    user hits submit and store the data the user typed. then for the default
    value of the textbox i have <%= Session("var") %> and that leaves the users
    data in the box for them to edit. is there a better way i could do this?
     
    SLH, Oct 2, 2006
    #1
    1. Advertising

  2. <input type=text name=FieldName
    value="<%=Server.HTMLEncode(Request.Form("FieldName"))%>">



    "SLH" <> wrote in message
    news:...
    >i have an asp page with a form that posts to itself. (the action of the
    >form is the same page the form is on). i validate input and dont accept it
    >if there is something wrong with it. problem is that when the form is
    >submitted, and i display the error message, the data the user typed in the
    >box is gone. i work around this by setting a session variable as soon as
    >the user hits submit and store the data the user typed. then for the
    >default value of the textbox i have <%= Session("var") %> and that leaves
    >the users data in the box for them to edit. is there a better way i could
    >do this?
    >
    >
     
    Aaron Bertrand [SQL Server MVP], Oct 2, 2006
    #2
    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. Mike Szanto

    Save data to server without postback?

    Mike Szanto, Jul 26, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    746
    bruce barker
    Jul 28, 2003
  2. Replies:
    3
    Views:
    17,124
    zz78_gang
    Aug 17, 2007
  3. subhadip
    Replies:
    0
    Views:
    638
    subhadip
    Mar 28, 2007
  4. chowchho
    Replies:
    7
    Views:
    634
    Patrice
    Mar 28, 2008
  5. Kirsten

    Save and recovering post data

    Kirsten, Sep 1, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    314
    Kirsten
    Sep 1, 2009
Loading...

Share This Page