Aug 02, 2007 03:00 PM|Orrin581|LINK
I would be grateful for some help with this.
I am using the example photo website application provided by Web Developer Express to learn Aspnet 2.
I have managed to add some extra functionality and this has taught me a bit. However, I am trying now to allow members to add comments to photos and at the same time allow non members to view these comments, but not add to them.
I will try to explain what I have:
In my Details.aspx page I have added a
LoginView, GridView and a Label(LabelPhotoID) to the FormView.
I am trying to use the PhotoId to populate the the Select and Insert queries in SqlDatasource1 which is the datasource for the Gridview.
I have bound the LabelPhotoID.Text to the PhotoID.
I thought I could use this value to identify the photo as it changed, and thus display the comments for each photo in the grid.
There seems to be lots of difficulties doing this.
The main one seems to be that you cannot see the LabelPhotoID component as it is inside the Item Template.
Even when I put the SqlDatasource inside also, although I could link a Paramater to LabelPhotoID.Text, it did not actually populate the Grid as each photo was displayed. You will see that I am pretty well lost. The page code is as follows:-
No Comments yet for this Photo
Sorry this seems such a muddle. I feel I could have done this sort of thing easier with Aspnet1 and WebMatrix. A lot more code behind but I felt i understood what was going on better.