WebControlAdapter duplicates <table> tag for GridView

Aug 28, 2008 at 1:11 PM

For a simple GridView, the HTML sent is like:

  <table id="grid2" AdapterEnabled="false">
    <table border="0" id="grid2">
        <th scope="col">name</th><th scope="col">age</th>

Steps to reproduce:

  •  Create a simple asp page that contains a simple GridView
    < asp : GridView ID ='grid2' runat =server AdapterEnabled ='false'></ asp : GridView >
  • Fill the GridView with whatever you want
  • Update or Create the browser file to use an adapter for the GridView:
    < browsers >
    < browser refID = " Default">
    < controlAdapters >
    < adapter controlType = " System.Web.UI.WebControls.GridView " adapterType = " System.Web.UI.WebControls.Adapters.WebControlAdapter"  />
Notice that we have the same problem if we use the SSFriendly.GridViewAdapter
and set AdapterEnabled='false' for the GridView so that it uses the default adapter.


Sep 18, 2008 at 6:30 PM
Is it possible that nobody has ever used the WebControlAdapter with the GridView ?

Jun 24, 2010 at 12:36 PM

Given the age of this thread, I'm surprised there aren't more replies. I just encountered this bug while writing a custom adapter for the GridView. You've probably found a solution of your own by now, but I thought I'd post mine in case anybody else does the same google search I did: deriving the adapter directly from ControlAdapter instead of WebControlAdapter fixes the issue.