CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2009
    Posts
    7

    save data on client before send to server

    hi
    in my webApp user input some value to fields and after all press send to send data to server,i wanna save data in client before sending to server.how can i do this ?

    Thanks :O)

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: save data on client before send to server

    Well you already have a solution in your question itself. Just save it on the client end too the same way you are saving at the server. How would that be?

    Jokes apart, this is too generic question to answer. What kind of application are you working on and how is the data stored on the server side? When you say server, do you mean a database server? Answers to these questions will help us in helping you.

  3. #3
    Join Date
    Jul 2009
    Posts
    7

    Re: save data on client before send to server

    client is a user who see the web pages,and the server is host of web application with MSSQL server database.
    i want to save data ( about 20 TextBox values ) in client like XML format or.. then send data to server.
    guide me please.

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: save data on client before send to server

    What is the need of that? Are you trying to add some extra kind of logic there?

    Anyways, in order to do that, you will have to use Client Side javascript and I am sure it would not be an easy task. You will have to ask the permission form the user to write to the user's system. I have never done it and I don't see a use of doing it when at the end the data would be saved at the Server side.

  5. #5
    Join Date
    Jul 2009
    Posts
    7

    Re: save data on client before send to server

    as you know,the most thing that some people prefer using Win App instead of Web App is avoiding data lost.for example if you fill some field and after all that wanna send data to server,connection lost,all data will lost,but if you save them and send,if data lost,its available to load them to user ..

  6. #6
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: save data on client before send to server

    I am not sure what you are talking about. Those days are long gone when we used to have Network connections that break quite often. I have been working on Web Apps for more than 6 years now and don't know of a single instance where a user complained that his data was lost because of a bad network connection.

  7. #7
    Join Date
    Aug 2006
    Location
    Hubli, India
    Posts
    70

    Re: save data on client before send to server

    I think you are trying to save the data so that if the browser closes by any means, you want to retreive.
    I would suggest 2 ways,

    1) try cookies
    2) try session

    But i dont know how to do it exactly using Java script on the client.

    Good luck
    Last edited by RajWolf; August 8th, 2009 at 07:33 AM. Reason: to be more specific

  8. #8
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: save data on client before send to server

    session is server side base and will be expired when user close explorer.
    better choice is cookie but it can be disabled bu users how ever these days most users have it enabled.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  9. #9
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: save data on client before send to server

    Cookies seems like the way to go as suggested above, but has size limitations.


    But you'll not be allowed to save data undiscriminately on the client as it is a huge security risk. You're much better off to program your web solution in a manner where you're not relying on, for example, session data, so the loss of "connection" is not a problem.
    If you want to save the data if the user turns off the computer or similar, you shouldn't use a web solution.

    Personally - I think you're trying to solve a problem which doesn't exists. And if it exists, I think you should look at your design for the solution once more, because then something is amiss there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured