Safe - Save Password as viewstate

Last post 12-03-2008 2:52 AM by Nezdet. 8 replies.

Sort Posts:

  • Safe - Save Password as viewstate

    12-01-2008, 10:08 PM
    • Member
      156 point Member
    • Nezdet
    • Member since 02-11-2007, 7:21 AM
    • Posts 722

    Is it safe to store password As viewstate??

    Or

    Should I connect to the database to get the password??

    CAUSE i get informations once before,,and maybee the performance gets better if I skip acces dabase one more time?

  • Re: Safe - Save Password as viewstate

    12-02-2008, 12:04 AM
    Answer

     ViewState is not the safe way to store the secure values. So, do not prefer to store the view state in ViewState.

       if you want to access the password more number of time store it in Object class. it would be better.
     

    Regards,
    Pavithru Pinnamaneni
  • Re: Safe - Save Password as viewstate

    12-02-2008, 12:29 AM
    • Member
      156 point Member
    • Nezdet
    • Member since 02-11-2007, 7:21 AM
    • Posts 722

    On Page_Load_Event I get data from database...   (here when i get the password maybee if I could save it in a safe place and reuse it when i click the button)

    I have a Button..

    this button checks if is teh same password as the one in database.

    How would u solve this??

    I could acces the datbase one more time.. but it would be many connections..

  • Re: Safe - Save Password as viewstate

    12-02-2008, 12:35 AM
    Answer

     Keep that in a Session it would be recommended as for your requirement.

     Session["Password"]=<value from DataBase>;

    access this session by checking whether session has value and retrieving the value 

    if(Session["Password"]!=null)

    string pwd= Session["Password"].ToString();   

    Regards,
    Pavithru Pinnamaneni
  • Re: Safe - Save Password as viewstate

    12-02-2008, 1:43 AM
    • Member
      156 point Member
    • Nezdet
    • Member since 02-11-2007, 7:21 AM
    • Posts 722

    okej so I would do this.. and if it doesn't have any password. then I should acces the database and ge the password.

    I have a Question.. My situation:

    I Open a page where it contains inforamtion about a Item (Price, model etc) ViewItem.aspx

    If the person whats to change the iteminformations he types the password and after that he moves to the RegPage.aspx.

    in the regPage I fill all the textboxes with all the data for this item.

     

    This was my Solution:
    My previous solutions was.. when a user opens the ViewItem.aspx it also saves the data in a clas and creates a viewstate with the class. and then it server transfers the viewstate to the RegPage.aspx and it filles all the textboxes with the data. 

    I don't know how good this was cause the the classfile that i saved as viewstate was very large..

    this is one other solution: I could send over the Itemid and then get data direct from SQL. I have over 2000 changes a day.. I don't know how this would effectr my server.

     What is the best soultions for a btter performance?

  • Re: Safe - Save Password as viewstate

    12-03-2008, 2:08 AM

    Nezdet:

    I don't know how good this was cause the the classfile that i saved as viewstate was very large..

    this is one other solution: I could send over the Itemid and then get data direct from SQL. I have over 2000 changes a day.. I don't know how this would effectr my server.

     What is the best soultions for a btter performance?

    Hi,
    If you often visit some data and those data does not often to change, you can cache the data after you get them from server,
    You can cache your personal data in session and public data in Cache;
    Then check this lick, hope that will help you.
    http://forums.asp.net/p/1260505/2354831.aspx


    Let me know whether that answers your question, or if I've missed something.

    Best Regards,
    Bober Song
    --------------------------------
    Please remember to click “Mark as Answer” on the post that helps you
  • Re: Safe - Save Password as viewstate

    12-03-2008, 2:26 AM
    • Member
      156 point Member
    • Nezdet
    • Member since 02-11-2007, 7:21 AM
    • Posts 722

    Thanks I will try to cache.. But I don't know when to remove the cache..

    let us say I create the cache when he Page_load event..

    But he doesn't forward after that, he goes back.. The cache has already been created.

    does it effect if i remove or don't remove the cache?

  • Re: Safe - Save Password as viewstate

    12-03-2008, 2:42 AM
    Answer

    Hi,

     If you use Cache for storaging some data,you can set time-expired time.


    Of cource, you should change the Cache when you change some data.

    And, please check following link:

    Caching For Performance
    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/caching/default.aspx

    Best Regards,
    Bober Song
    --------------------------------
    Please remember to click “Mark as Answer” on the post that helps you
  • Re: Safe - Save Password as viewstate

    12-03-2008, 2:52 AM
    • Member
      156 point Member
    • Nezdet
    • Member since 02-11-2007, 7:21 AM
    • Posts 722

    So I need to make some check..

    If teh chache has been deleted then connect to datbase else get from chache

Page 1 of 1 (9 items)