I have read this post, but I think my question is a little different.
The gridview count is not determined until the runtime. So I just add a PlaceHolder control to the page, and add the GridView control into the PlaceHolder dynamically.
I use VS 2005 with c#. It's code behinde file. And I have no idea where to put <div> into page scripts.