views:

95

answers:

3

Here is the situation, i have two tables tblProduct and tblCategory, what i am trying to do is populate a gridview, i have LinqDataSource binded to the grid and the correct association made inside the .dbml (tblProduct.CategoryID to tblCategory.ID).

To show the fields from tblCategory instead of the tblProduct.CategoryID in the GridView i am using :

<ItemTemplate>
    <asp:Label ID="Label5" runat="server" Text='<%# Eval("tblCategory.Name") %>'>
    </asp:Label>
</ItemTemplate>

This works fine inside the VS2008 debugger, but once its published to the server (2003 + IIS6.0) the column that belong to tblCategory simply don't show, instead of having the category name (tblCategory.Name) displayed like it does inside the debugger it is blank, no errors simply wont show.

Can anyone shed some light in this?

A: 

I mocked up a the tables and .aspx page you described and am not having any trouble. My intuition says that this isn't a code problem, but a deployment problem. I'm wondering:

  1. Are you set up with a "web site" project or a "web application"?
  2. If you're using a "web site" project, which options do you have selected on deploy (ie: "Allow this precompiled site to be updateable", "Use fixed naming and single page assemblies", etc.)
  3. Have you tried deploying to a new, clean area on your web server instead of overtop of a previous release?
mattmc3
Matt, the project was set up as a "web application", after reading your post i created a new "web site" project and got the exact same result, i have only the "Allow this precompiled site to be updateable" checked and created a new area on the web server and redeployed it from scratch, nothing changed, is there any other test i can do?Thanks in advance.
OldJim
Shoot. I've seen more of this sort of trouble with 'web site' projects than 'web application' projects, so I was hoping that your problem was the other way around.
mattmc3
A: 

What methods have you used to ensure the the version you are looking at on the server is the same that you have on your development machine?

Perhaps try adding a comment to the bottom of your development page, then redeploying. If you can't see the comment on the published version you know something else is wrong with your deployment.

eoldre
i have done that, i have even cleaned the whole thing from the server and recreating everything from scratch with no luck, i am positive that the versions match, thank you for taking the time to answer.
OldJim
A: 

I could not after all figure out exactly what was going on, but by enabling the options "Enable Insert", "Enable Update" and "Enable Delete" on the DataSource the problem was solved and the columns started showing properly on the GridView even though i do not use any of those functions, the GridView is used only to display data.

I have no clue why would one thing be connected to the other, my best guess is that perhaps to use TemplateFields you must have those options enabled.

I any event, it is working now, thanks to the people who have tried to help.

OldJim