Why my page is Posted Back??

Posted by Laghaterohan under Regular Expressions on 12/21/2010 | Points: 10 | Views : 1160 | Status : [Member] | Replies : 4
Hello,

I have a Gridview with 4 columns and i have a Select and a Delete button.

I bind the data to the gridview whose datasource is a dynamically created datatable.

My question is why does my page is posted back when i fire a Delete event or Edit event in my GridView..ie..my code inside (!isPostBack) also gets executed !! why is it so and how can we overcome it??


Thanks!!
Happy Coding :)

Best Regards,
Rohan Laghate



Responses

Posted by: Vuyiswamb on: 12/21/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Add your gridview inside an Update Panel it will not flicker

Thank you for posting at Dotnetfunda
[Administrator]

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 12/21/2010 [Member] Starter | Points: 25

Up
0
Down
Hi,
Its not about flicker....i mean to ask why is my code written inside if(!isPostBack) being executed for each select or edit event???


Thanks!!

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 12/21/2010 [Member] Starter | Points: 25

Up
0
Down
You can post your code here and we shall try to find the problem and provide you the solution. Generally when your code block is inside !IsPostBack that should not fire when your page is being posted back.

Are you by any chance redirecting on the same page when you are clicking Delete ?

Thanks

Regards,
Raja, USA

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/6/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Use ajax update panel.. it will not post back... hope you know the functionality of AJAX

Thanks
Karthik
www.f5Debug.net

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response