Postback question

J

Jeti [work]

I override IPostBackDataHandler interface, and implement my code in the
following method:
public bool LoadPostData(string postDataKey, NameValueCollection
postCollection)
{
}

by default, this method returns "false"... what does this return value
affects? i tried to return "true", but nothoing different happened.



thanks
 
J

Joerg Jooss

Jeti said:
I override IPostBackDataHandler interface, and implement my code in
the following method:
public bool LoadPostData(string postDataKey, NameValueCollection
postCollection)
{
}

by default, this method returns "false"... what does this return value
affects? i tried to return "true", but nothoing different happened.

Return true if LoadPostData changes your control's state, and false
otherwise.

Cheers,
 
J

Jeti [work]

by default, this method returns "false"... what does this return value
Return true if LoadPostData changes your control's state, and false
otherwise.


Thanks for the reply...
 
W

William F. Robertson, Jr.

The IPostBackDataHandler has two methods

bool LoadPostData(...);
void RaisePostDataChangedEvent();

When you return true from LoadPostData, it will call
RaisePostDataChangedEvent. For example, you have a text box control. When
you LoadPostData, you might determine the value has changed across
postbacks, so you would return true.

If your RaisePostDataChangedEvent you would raise your TextChanged event.
They are two seperate operations because the framework will give all
controls a change to process their postback data before raising any events.

HTH,

bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top