Page.IsPostBack

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To make !Page.IsPostBack to work, do I need to set any properties at page
level or in the config files(Web, machine) or aspx files. Because code in
under the !IsPostBack is executing twice and adding data twice to dropdown
list control.

any help please..Tim
 
Are you doing any redirects? Postback only happens when the form is posted
using a submit command.
 
No I am not redirecting, this page is getting called from authentication
page. There are links on this page to go to other page.
 
Hi Peter,

Actually this page is getting redirected from other authentication page,
does it causes the problem.
 
Tim, I tried for you both single Page and a redirected Page from a Login one
but I didn't get any error ! So Redirecting doesn't cause twice adding.
Are you sure you did populate DropDownList just in (!Page.IsPostBack) block.
Maybe you did it from Properties --> Items collection before//
 
The Login page is getting redirected from Authentication page. I have put
the code under Login Page_Load event in !Page.IsPostBack blcok.

Do I need to chenk 'EnableViewState', 'AutoPostBack' of dropdown,
'AutoExecWireup' in config files properties. Please let me know.
 
Back
Top