Wednesday, May 7, 2008

Bug Fix For Unknown Runtime Error for Gridview inside Update panel

 

image

If we use CSS Friendly,
This happen if I put GridView Under Update Panel without table.

But finally I found that in my master page there is this strange tag.
<a name="body" />

After remove this, Everything works fine.
Here is the reference.
http://damianpedwards.spaces.live.com/blog/cns!A079DE667E1958B3!562.entry

The most explanation that I found so far is this
=====From Lewis =====
http://cyrilgupta.com/wp/?p=110
I found that this error is caused by having a a html ‘form’ element somewhere inside the postback html.
After taking out the form tags (and any asp.net controls generating them) from the updatePanel’s contentTemplate, the error went away.
=====================

However , I still don't understand If I put your GridView outside update panel and keep EnableSortingAndPagingCallbacks="True"


When I click on Paging and Sorting, It throw error Microsoft JScript runtime error: 'panelElement' is null or not an object.
image

I think this is cause by CSS Friendly, because If I take the CSS Friendly out for GridView, It works fine
Any comment ?

No comments: