Home All Groups Group Topic Archive Search About

ASP.NET 2.0 DataView DetailsView ImageField displaying images from

Author
23 Mar 2006 6:45 PM
whyman
I have read several documents that use Imagefield and DataField in the
examples in Visual Studio 2005.  I am new to Visual Studio, so I am going
through tutorials, and code I find from the internet.  Code from Microsofts
site below.

<asp:GridView ID="GridView1" 
        DataSourceID="ProductsSource"
        AutoGenerateColumns="false"
        Runat="Server">
        <Columns>
            <asp:BoundField
                DataField="LastName"
                NullDisplayText="no value" />
            <asp:ImageField HeaderText="" DataField="photo" />
        </Columns>
    </asp:GridView>

When I try to use the ImageField in this manner I receive an error.
(Validation (ASP.Net): Attribute 'DataField' is not a valid attribute of
element 'ImageField'.)  I receive the same error from a detailsview as well. 
Has this been taken out of ASP.NET 2.0 or am I missing somthing that I do not
understand?

Thank you for any help you can give

Author
23 Mar 2006 7:00 PM
Phillip Williams
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.imagefield(VS.80).aspx
Show quoteHide quote
"whyman" wrote:

> I have read several documents that use Imagefield and DataField in the
> examples in Visual Studio 2005.  I am new to Visual Studio, so I am going
> through tutorials, and code I find from the internet.  Code from Microsofts
> site below.
>
> <asp:GridView ID="GridView1" 
>         DataSourceID="ProductsSource"
>         AutoGenerateColumns="false"
>         Runat="Server">
>         <Columns>
>             <asp:BoundField
>                 DataField="LastName"
>                 NullDisplayText="no value" />
>             <asp:ImageField HeaderText="" DataField="photo" />
>         </Columns>
>     </asp:GridView>
>
> When I try to use the ImageField in this manner I receive an error.
> (Validation (ASP.Net): Attribute 'DataField' is not a valid attribute of
> element 'ImageField'.)  I receive the same error from a detailsview as well. 
> Has this been taken out of ASP.NET 2.0 or am I missing somthing that I do not
> understand?
>
> Thank you for any help you can give
Author
23 Mar 2006 7:28 PM
whyman
Thank you for your help.  I was coming to the conclusion that it is not
possible the way several people were demonstrating anyway.  Here is the link
to one of the articles I have found that state what I am confused about. http://msdn.microsoft.com/asp.net/reference/data/default.aspx?pull=/library/en-us/dnvs05/html/grddetview.asp

Show quoteHide quote
"Phillip Williams" wrote:

> http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.imagefield(VS.80).aspx
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "whyman" wrote:
>
> > I have read several documents that use Imagefield and DataField in the
> > examples in Visual Studio 2005.  I am new to Visual Studio, so I am going
> > through tutorials, and code I find from the internet.  Code from Microsofts
> > site below.
> >
> > <asp:GridView ID="GridView1" 
> >         DataSourceID="ProductsSource"
> >         AutoGenerateColumns="false"
> >         Runat="Server">
> >         <Columns>
> >             <asp:BoundField
> >                 DataField="LastName"
> >                 NullDisplayText="no value" />
> >             <asp:ImageField HeaderText="" DataField="photo" />
> >         </Columns>
> >     </asp:GridView>
> >
> > When I try to use the ImageField in this manner I receive an error.
> > (Validation (ASP.Net): Attribute 'DataField' is not a valid attribute of
> > element 'ImageField'.)  I receive the same error from a detailsview as well. 
> > Has this been taken out of ASP.NET 2.0 or am I missing somthing that I do not
> > understand?
> >
> > Thank you for any help you can give
Author
23 Mar 2006 7:46 PM
Phillip Williams
Taken that the article is dated July 2004, it must have been the syntax for
the ImageField in one of the pre-release versions at the time.  I would
suggest using this site to check the updated release syntax:
http://msdn2.microsoft.com/en-us/library/default.aspx
Show quoteHide quote
"whyman" wrote:

> Thank you for your help.  I was coming to the conclusion that it is not
> possible the way several people were demonstrating anyway.  Here is the link
> to one of the articles I have found that state what I am confused about.
> http://msdn.microsoft.com/asp.net/reference/data/default.aspx?pull=/library/en-us/dnvs05/html/grddetview.asp
>
> "Phillip Williams" wrote:
>
> > http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.imagefield(VS.80).aspx
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "whyman" wrote:
> >
> > > I have read several documents that use Imagefield and DataField in the
> > > examples in Visual Studio 2005.  I am new to Visual Studio, so I am going
> > > through tutorials, and code I find from the internet.  Code from Microsofts
> > > site below.
> > >
> > > <asp:GridView ID="GridView1" 
> > >         DataSourceID="ProductsSource"
> > >         AutoGenerateColumns="false"
> > >         Runat="Server">
> > >         <Columns>
> > >             <asp:BoundField
> > >                 DataField="LastName"
> > >                 NullDisplayText="no value" />
> > >             <asp:ImageField HeaderText="" DataField="photo" />
> > >         </Columns>
> > >     </asp:GridView>
> > >
> > > When I try to use the ImageField in this manner I receive an error.
> > > (Validation (ASP.Net): Attribute 'DataField' is not a valid attribute of
> > > element 'ImageField'.)  I receive the same error from a detailsview as well. 
> > > Has this been taken out of ASP.NET 2.0 or am I missing somthing that I do not
> > > understand?
> > >
> > > Thank you for any help you can give
Author
23 Mar 2006 7:53 PM
whyman
Thank you very much.

Show quoteHide quote
"Phillip Williams" wrote:

> Taken that the article is dated July 2004, it must have been the syntax for
> the ImageField in one of the pre-release versions at the time.  I would
> suggest using this site to check the updated release syntax:
> http://msdn2.microsoft.com/en-us/library/default.aspx
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "whyman" wrote:
>
> > Thank you for your help.  I was coming to the conclusion that it is not
> > possible the way several people were demonstrating anyway.  Here is the link
> > to one of the articles I have found that state what I am confused about.
> > http://msdn.microsoft.com/asp.net/reference/data/default.aspx?pull=/library/en-us/dnvs05/html/grddetview.asp
> >
> > "Phillip Williams" wrote:
> >
> > > http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.imagefield(VS.80).aspx
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "whyman" wrote:
> > >
> > > > I have read several documents that use Imagefield and DataField in the
> > > > examples in Visual Studio 2005.  I am new to Visual Studio, so I am going
> > > > through tutorials, and code I find from the internet.  Code from Microsofts
> > > > site below.
> > > >
> > > > <asp:GridView ID="GridView1" 
> > > >         DataSourceID="ProductsSource"
> > > >         AutoGenerateColumns="false"
> > > >         Runat="Server">
> > > >         <Columns>
> > > >             <asp:BoundField
> > > >                 DataField="LastName"
> > > >                 NullDisplayText="no value" />
> > > >             <asp:ImageField HeaderText="" DataField="photo" />
> > > >         </Columns>
> > > >     </asp:GridView>
> > > >
> > > > When I try to use the ImageField in this manner I receive an error.
> > > > (Validation (ASP.Net): Attribute 'DataField' is not a valid attribute of
> > > > element 'ImageField'.)  I receive the same error from a detailsview as well. 
> > > > Has this been taken out of ASP.NET 2.0 or am I missing somthing that I do not
> > > > understand?
> > > >
> > > > Thank you for any help you can give