Hi,
 
Thanks Robert,
 
IsPostBack can differentiate only first time method calls  and subsequest method calls...
 
In my case before saving the page, may be page is already post back (like for filling some list boxes from database)  one or more times.... So click on save button and pressing F5 after that, has no difference for IsPostBack (in both cases it will return true)

I think now i have given more clear situation...
 
With Regards,
Pankaj Tyagi
VCLABS
 
----- Original Message -----
From: Rob
Sent: Monday, July 04, 2005 9:50 PM
Subject: RE: [Microsofts_C_Sharp] Page Refresh Problem.....

Simple, try this

 

If (!IsPostback)

{

            DoMethodsForFirstTime();

            SecondMethod();

            IntilizeComponent();

 

}

 

This is postback(Boolean) will be set to true when a page has executed for the first time and false if its been run for the first time. Hope this helps J

 


From: [email protected] [mailto:[email protected]] On Behalf Of Pankaj Tyagi
Sent: 04 July 2005 14:30
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [email protected]
Subject: [Microsofts_C_Sharp] Page Refresh Problem.....
Importance: High

 

Hi Everyone,

i have a very simple question regarding ASP .net (Using C#)

 

i have a data entry form, on save click record gets inserted in databse.

 

Now if i refresh this page usign F5 or by any other way...new record gets inserted in databse with same values,  i want to stop this

 

i also want to clear values of all controls on click of save, and if user refresh the page nothing should happen.... 

 

For this, i do not want to put validation on database end...  How can i do this....

 

Thanks in advance...

 

With Regards,
Pankaj Tyagi

VCLABS,

New Delhi, India

 

 

 

 

 

 



YAHOO! GROUPS LINKS




Reply via email to