Monday, August 16, 2010

Dynamic .NET Images?

I am new to ASP.NET and web design and was wondering how would you create a dynamic image in .NET. I am connected to a SQL server which holds all the data and currently have it all set up in a gridview, i need to now get each image displayed uniquely. I can get the image file name to appear but not the actual image itself. thank you.Dynamic .NET Images?
Use Template column to display image. Bind the datasource to datagrid through Dataset (filled with databased values including path from database) %26amp; type below code in


HTML source





Here is the code








%26lt;asp:Datagrid id=';dgImage'; runat=server AutoGenerateColumns=false%26gt;


%26lt;Columns%26gt;


%26lt;asp:templatecolumn HeaderText=';Image';%26gt; %26lt;ItemTemplate%26gt; %26lt;img


src='%26lt;%# DataBinder.Eval(Container, ';DataItem.ImgPath';) %%26gt;'


/%26gt; %26lt;/ItemTemplate%26gt;


%26lt;/asp:templatecolumn%26gt;


%26lt;/Columns%26gt;


%26lt;/asp:DataGrid%26gt;
  • web hosting talk
  • loan
  • No comments:

    Post a Comment