How to rid of empty div that contains a GridView

前端 未结 8 830
时光说笑
时光说笑 2021-01-11 18:21

In ASP.NET Gridviews generate a table which generates a parent div container. This can break CSS layouts since there is no way to attach styles to the generated div. Is ther

8条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-11 18:55

    I've never done this, but I my first guess would be you could grab the rendered html output just before it gets to the browser, remove the outer div and then htmltextwrite out your new rendered html in the prerender event or make a user or custom control to do this.

    But then you risk breaking the functionality of the gridview but if you know you won't be using the features that use the div, then you might get away with it.

提交回复
热议问题