Last post May 29, 2007 01:44 PM by fvaldivia
May 04, 2007 11:31 AM|fvaldivia|LINK
I am trying to include a file, which will work as a footer for the main page. I currently have a GridView that gets populated by a DataSource.
For this reason the GridView is dynamic in terms of how many rows it'll display. I place the code to include the "footer" file for the page at the end, right before the closing form tag (</form>) but when I launch the page, the footer always shows first at
the top then the Gridview. I've used both the "#include" directive and the "Response.WriteFile()" command and the result is the same.
Does anyone know why this is happening and more importantly does anyone know how to get this to work?
May 04, 2007 06:08 PM|SGWellens|LINK
The order of things in your ASP page is not necessarily the order in which they get rendered.
A solution would be to add an html table from the Layout->Insert Table menu. Use 2 rows, 1 column, 100 percent wide. Put the GridView in the upper row and the footer in the lower row.
May 09, 2007 02:53 AM|Hong-Gang Chen - MSFT|LINK
According to your request, I agree the point of SGWELLENS’S.
And , at same time, I write a small demo for you as following:
GridView gv =
gv.DataSource = BLL.GetOderList();
Hope it helps.
May 09, 2007 03:11 AM|Nimit Patel|LINK
You create one separate user control which include at the bottom of page (as a footer).
In user control you work as normal aspx page for connecting and accessing database, adding any object control/s.
May 25, 2007 03:10 PM|fvaldivia|LINK
Well for a moment I thought it was going to work but it doesn't. Your code shows creating the GridView dynamically and adding it to the Panel control. However, in my case I have the GridView already defined in design mode and that is because I am using
"TemplateFields". What is dynamic is the number of rows will display because it depends on the records that are fetched from the Database. Even though I add the GridView to the Panel as the last task in the Load event of the page, it is still displayed in
the wrong location of the form.
I appreciate the tip however.
May 25, 2007 03:13 PM|fvaldivia|LINK
For some reason when I drag the GridView into the table, the table does not recognize it. I programmatically added the GridView into the cell of the first row and still it doesn't appear where it is suppose to.
Thank you for replying, I'll keep trying.
May 25, 2007 06:04 PM|SGWellens|LINK
You can go into the asp code and cut-and-paste the GridView code into the cell you want.
May 29, 2007 12:34 PM|fvaldivia|LINK
I've tried that and the GridView still displays outside of the table cell. I removed the "top" property of the GridView and that made it display right up agains the top of the table cell but the cell was still colapsed and the second row where the footer
would go displays right underneith the first row. So what comes out is the table with a collapsed cell, and a second row with the footer and on top of the table is the GridView. In other words the tablecell where the GridView should be in does not seem to
contain the GridView. I changed the height of the cell manually and that opens the cell. I then tried to set the "height" of the tablecell to the "height" of the GridView but the height of the GridView is set to 0. Maybe because it is dynamically created.
I guess I'll keep trying.
Thank you again for your effort in helping me.
May 29, 2007 01:44 PM|fvaldivia|LINK
Well, I've created a Master Page, there I added a table with two rows and one cell. On the second row I placed the #include statement and on the first row I placed a ContentPlaceHolder control. I added a new web form and selected to attach it to the Master
Page above. And guess what, still if the GridView grows longer and passes the location of where the footer exists, it just places itself on top of it. and the footer gets lost because it is under the GridView. The footer will show if the GridView does not
enough rows to pass the location of the footer.
At this point, I don't think there is a solution to this problem. Maybe someone from Microsoft should look at it and help us out. Of course they might be busy adding "new features" to ASP.NET.
Anyway, any help will be appreciated!!