Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: page.IsPostBack Problems


Message #1 by "Will Fisher" <wkfisher@b...> on Thu, 5 Sep 2002 10:01:57 -0700
Hello,

I am making a simple application that will take in Name, Salary, and Hours
and compute gross pay, taxes, and net pay.

Right now I have something like this,Pardon the lowsy pseudo code:

<script>

Page load
end sub

sub calculate(source, E)
dim hours, payrate
pay = hours * payrate
End sub

<body>
''bunch of html
button onclick = "calculate"



Everything works except that when I make a calculation and then bring the
page up again.  It says something about the form data having to be reloaded
from the server.  I click "retry" and then the page is loaded again.  The
problem is that the values I had entered the first time are still there.

I know the problem lies in the page.IsPostBack but I'm not sure the code I
should use given that nothing is really happening in the Page_Load Sub.

I've tried a
if page.IsPostBack = "true" then
payrate = ""
hours = ""

...No Luck

Thanks in advance-will


Message #2 by "Ramesh Kandasamy" <rame10@y...> on Thu, 12 Sep 2002 05:32:58
Try this.

if Not page.IsPostBack then
payrate = ""
hours = ""
End if

OR

if page.IsPostBack = true then
payrate = ""
hours = ""
end if


> 
Hello,

I am making a simple application that will take in Name, Salary, and Hours
and compute gross pay, taxes, and net pay.

Right now I have something like this,Pardon the lowsy pseudo code:

<script>

Page load
end sub

sub calculate(source, E)
dim hours, payrate
pay = hours * payrate
End sub

<body>
''bunch of html
button onclick = "calculate"



Everything works except that when I make a calculation and then bring the
page up again.  It says something about the form data having to be reloaded
from the server.  I click "retry" and then the page is loaded again.  The
problem is that the values I had entered the first time are still there.

I know the problem lies in the page.IsPostBack but I'm not sure the code I
should use given that nothing is really happening in the Page_Load Sub.

I've tried a
if page.IsPostBack = "true" then
payrate = ""
hours = ""

...No Luck

Thanks in advance-will



  Return to Index