ASP.NET viewstate question

  • Thread starter Thread starter nologo
  • Start date Start date
N

nologo

i wish to store a users custom role in a viewstate...
is this advised?or shall i use profiles?
sorry im a new comer to asp.net so not sure of all the tricks etc.
 
sorry im a new comer to asp.net so not sure of all the tricks etc.

One good trick is to use the aspdotnet group :-)
 
nologo said:
i wish to store a users custom role in a viewstate...
is this advised?or shall i use profiles?
sorry im a new comer to asp.net so not sure of all the tricks etc.

The ViewState only applies to the current page; it will be lost as soon
as the user navigates to a different page. So it wouln't be adequate for
storing a user's role.
Profiles might be a good choice depending on what you mean by "custom
role". Other alternatives would be the Session state, or a Cookie, or a
GenericIdentity in the current Thread, depending on what you are trying to
accomplish, how you manage roles and when you wish to apply them. Have you
taken a look at the built-in RoleManager?
 
i wish to store a users custom role in a viewstate...
is this advised?or shall i use profiles?
sorry im a new comer to asp.net so not sure of all the tricks etc.

ViewState only applies for the current page. It's used to stores
values between postback (before you would have to use Hidden Fields).

You could use Session to store data related to the whole session.

there is a asp.net NG, you should check it out.
 
ViewState only applies for the current page. It's used to stores
values between postback (before you would have to use Hidden Fields).

You could use Session to store data related to the whole session.

there is a asp.net NG, you should check it out.

you can store data in viewstate if you want to use it again after
postback in one page , if you want to pass data between pages you need
to use Session (iis stores session ids for each browser session).
 
Back
Top