Hi,
Initially I intend to display my images in the cells of DetailView, as you can see the 2 lines with italic letters. Of course, it fails to show anything. Then I add <asp:image ImageURL...........> (you can see in Italic), it still doesn't work. Does it connect to my AccessDataSource2 when I put them in this way?
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Information Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="1280px">
<ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Home">
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Search">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Please select code:" Width="130px"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="AccessDataSource1"
DataTextField="Code" DataValueField="ID" AutoPostBack="True">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/drugdata.mdb"
SelectCommand="SELECT [Code], [ID] FROM [tbDrug]">
</asp:AccessDataSource> <hr />
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="AccessDataSource2" Height="60px" Width="965px" FieldHeaderStyle-Width="70px">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<RowStyle BackColor="#DEDFDE" ForeColor="Black" HorizontalAlign="Left" VerticalAlign="Top"/>
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<Fields>
<asp:BoundField DataField="Code" HeaderText="Code" SortExpression="Code" />
<asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="OriginName" HeaderText="OriginName" SortExpression="OriginName" />
<asp:BoundField DataField="TradeName" HeaderText="TradeName" SortExpression="TradeName" />
<asp:BoundField DataField="Form" HeaderText="Form" SortExpression="Form" />
<asp:BoundField DataField="Packing" HeaderText="Packing" SortExpression="Packing" />
<asp:BoundField DataField="Contents" HeaderText="Contents" SortExpression="Contents" />
<asp:BoundField DataField="Dosage" HeaderText="Dosage" SortExpression="Dosage" />
<asp:BoundField DataField="Indication" HeaderText="Indication" SortExpression="Indication" />
<asp:BoundField DataField="Contraindication" HeaderText="Contraindication" SortExpression="Contraindication" />
<asp:BoundField DataField="Precaution" HeaderText="Precaution" SortExpression="Precaution" />
<asp:BoundField DataField="Warning" HeaderText="Warning" SortExpression="Warning" />
<asp:BoundField DataField="SideEffect" HeaderText="SideEffect" SortExpression="SideEffect" />
<asp:BoundField DataField="PregCategory" HeaderText="PregCategory" SortExpression="PregCategory" />
<asp:BoundField DataField="Shape" HeaderText="Shape" SortExpression="Shape" />
<asp:BoundField DataField="Company" HeaderText="Company" SortExpression="Company" />
<asp:BoundField DataField="Image1" HeaderText="Image1" SortExpression="Image1" />
<asp:BoundField DataField="Image2" HeaderText="Image2" SortExpression="Image2" />
</Fields>
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
<EditRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
<asp:image ImageUrl='<%# Eval("Image1", "~/drugimages/{0}") %>' runat="server" id="Image1"
style="float:left; border: none; margin-right: 10px;" />
<asp:image ImageUrl='<%# Eval("Image2", "~/drugimages/{0}") %>' runat="server" id="Image2"
style="float:left; border: none; margin-right: 10px;" />
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/drugdata.mdb"
SelectCommand="SELECT tbCategory.*, tbDrug.*, tbForm.* FROM (tbCategory INNER JOIN tbDrug ON tbCategory.ID = tbDrug.CategoryID) INNER JOIN tbForm ON tbDrug.FormID = tbForm.ID WHERE tbDrug.ID =?">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" DefaultValue="1" Name="ID" PropertyName="SelectedValue" />
</SelectParameters>
</asp:AccessDataSource>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</asp:Content>