Postback not behaving as expected

T

Trevor Benedict

Will be much easier if you can paste the code that you are using.

Regards,

Trevor Benedict
MCSD
 
B

blinton25

Hi,

Ok, thanks. I actually used:

<%@ Page EnableViewState="false" %>

Thanks again.
 
J

Jeff Dillon

No need to worry about viewstate. If you read the instructions, you will
note that the Date/Time is supposed to show on PostBack, but the time won't
change
 
T

Trevor Benedict

The reason I asked for the code was to make sure the OP was using the code
exactly as-is. sometimes copy-paste can create issues in itself.

Regards,

Trevor Benedict

Mark Rae said:
[top-posting corrected]
Will be much easier if you can paste the code that you are using.

He's using the code in the web page that he said he was using...
 
S

Sam

Hi,

Trying some sample code at:

http://www.w3schools.com/aspnet/aspnet_events.asp (The Page.IsPostBack
Property)

I believe that the first time the page is loaded the date should be printed,
but when I click the button, the date will not be shown. However the date
continues to be shown.

Any idea why this is occuring?

I think you are misunderstanding the example. The date will always be
shown, but as you can verify the date and time value displayed never
changes, because it is only set on the first time the page is loaded.
If you refresh the page, you'll see the date and time value change.
So the label value is set once on the initial page load and is never
changed again with subsequent post backs.

Thanks,

Sam
 
B

blinton25

Hello,

Thanks for your responses, they allowed me to understand the original
example and then modify it.

Jeff Dillon said:
No need to worry about viewstate. If you read the instructions, you will
note that the Date/Time is supposed to show on PostBack, but the time won't
change
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top