由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - static or else?
相关主题
Drawbacks of using static有哪些方法可以提高网站的perfermance?
Button's refresh problem Performance Profiling
一个dropdownlist的问题baozi for help a simple way C# program
请教如何initialize sessionclicks by reference
ASP.NET 难题测试 (2)dynamic change before refreshing
datagrid helpAnswer Re: ASP.NET 难题测试 (1)
Free Video Training: ASP.NET MVC 3 Featuresasp.net webhosting
不知阿里巴巴是如何实现静态分页的关于用自家电脑做网站服务器的一个技术问题
相关话题的讨论汇总
话题: page话题: ispostback话题: cache话题: postback
进入DotNet版参与讨论
1 (共1页)
c*o
发帖数: 70
1
Once a button is clicked on a web form, a Post message will send to the
server, where the code Page_Load () will be executed. However, I don't want to
initialize the Profile p again, so I put it is !IsPostBack(). But in this
case, the p will be null in the button's click event handling function
lkbtEmail_Click(). If I put initProfile() out of !IsPostBack(). It works. But
the initProfile() is a procedure which get a lot of information from the
database. I just want to do it once. How can I do it?
n*********g
发帖数: 75
2
Session?
ViewState?

【在 c*o 的大作中提到】
: Once a button is clicked on a web form, a Post message will send to the
: server, where the code Page_Load () will be executed. However, I don't want to
: initialize the Profile p again, so I put it is !IsPostBack(). But in this
: case, the p will be null in the button's click event handling function
: lkbtEmail_Click(). If I put initProfile() out of !IsPostBack(). It works. But
: the initProfile() is a procedure which get a lot of information from the
: database. I just want to do it once. How can I do it?

r***e
发帖数: 38
3
Try to do initProfile() in Page_Init()

to
But

【在 c*o 的大作中提到】
: Once a button is clicked on a web form, a Post message will send to the
: server, where the code Page_Load () will be executed. However, I don't want to
: initialize the Profile p again, so I put it is !IsPostBack(). But in this
: case, the p will be null in the button's click event handling function
: lkbtEmail_Click(). If I put initProfile() out of !IsPostBack(). It works. But
: the initProfile() is a procedure which get a lot of information from the
: database. I just want to do it once. How can I do it?

k****i
发帖数: 1072
4
Each time a request comes,not matter it's a new request or postback,a new
application object will be created(or from application object pool).Postback
request only restore the info stored in the viewstate bag.So store ur profile
somewhere like session,application,viewstate,cache,cookie,hidden field and
retrieve it back.

to
But

【在 c*o 的大作中提到】
: Once a button is clicked on a web form, a Post message will send to the
: server, where the code Page_Load () will be executed. However, I don't want to
: initialize the Profile p again, so I put it is !IsPostBack(). But in this
: case, the p will be null in the button's click event handling function
: lkbtEmail_Click(). If I put initProfile() out of !IsPostBack(). It works. But
: the initProfile() is a procedure which get a lot of information from the
: database. I just want to do it once. How can I do it?

c*o
发帖数: 70
5
Your comments are very helpful. Would you please recommend any in-depth
illustration links or books about this issue? Thank you soooooooooo much!

profile
want

【在 k****i 的大作中提到】
: Each time a request comes,not matter it's a new request or postback,a new
: application object will be created(or from application object pool).Postback
: request only restore the info stored in the viewstate bag.So store ur profile
: somewhere like session,application,viewstate,cache,cookie,hidden field and
: retrieve it back.
:
: to
: But

k****i
发帖数: 1072
6
msdn,"essential asp.netwith examples in c#,etc.

pool).Postback
this
works.

【在 c*o 的大作中提到】
: Your comments are very helpful. Would you please recommend any in-depth
: illustration links or books about this issue? Thank you soooooooooo much!
:
: profile
: want

b********s
发帖数: 12
7
Session or page cache would be the good choice. For page cache,you can check
"Cache Services" chapter at http://www.asp.net/Tutorials/quickstart.aspx .
Cookie has limited size and some security issue.

pool).Postback
this
works.

【在 c*o 的大作中提到】
: Your comments are very helpful. Would you please recommend any in-depth
: illustration links or books about this issue? Thank you soooooooooo much!
:
: profile
: want

k****i
发帖数: 1072
8
Sometimes hidden field is a better choice.Think about what happend if the user
hit the back button in IE and they want to rollback to previous state.

new
and
the
the
declare

【在 b********s 的大作中提到】
: Session or page cache would be the good choice. For page cache,you can check
: "Cache Services" chapter at http://www.asp.net/Tutorials/quickstart.aspx .
: Cookie has limited size and some security issue.
:
: pool).Postback
: this
: works.

b********s
发帖数: 12
9
Could be. I prefer to use page cache or session.Page cache can store any
object as you like.This is design choice. Let us leave it to cio.

user
check
much!
don't
function

【在 k****i 的大作中提到】
: Sometimes hidden field is a better choice.Think about what happend if the user
: hit the back button in IE and they want to rollback to previous state.
:
: new
: and
: the
: the
: declare

1 (共1页)
进入DotNet版参与讨论
相关主题
关于用自家电脑做网站服务器的一个技术问题ASP.NET 难题测试 (2)
C#版ruby太慢了datagrid help
any good .net profiler?Free Video Training: ASP.NET MVC 3 Features
用DLL会快些吗? 不知阿里巴巴是如何实现静态分页的
Drawbacks of using static有哪些方法可以提高网站的perfermance?
Button's refresh problem Performance Profiling
一个dropdownlist的问题baozi for help a simple way C# program
请教如何initialize sessionclicks by reference
相关话题的讨论汇总
话题: page话题: ispostback话题: cache话题: postback