Images not showing up in Firefox

Discussion in 'ASP.NET / ASP.NET Core' started by annbransom, Apr 26, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have four databound image controls on a webpage. The images show up fine in IE, but don't show up at all in Firefox. I have tried making the paths dedicated and that didn't help. Here is my code:

    Dim sqlConn As SqlConnection = New SqlConnection(dbConn)
    Dim sqlCmd As SqlCommand = New System.Data.SqlClient.SqlCommand()
    Dim sqlAdapter As SqlDataAdapter = New SqlDataAdapter
    Dim SelectStatement As String
    Dim dt As New DataTable
    SelectStatement = 'SELECT * FROM Vehicles WHERE StockNo = '' & Request.QueryString('ID') & '''


    With sqlCmd
    .Connection = sqlConn
    .CommandType = CommandType.Text
    .CommandText = SelectStatement
    End With

    sqlConn.Open()
    sqlAdapter.SelectCommand = sqlCmd
    sqlAdapter.Fill(dt)
    sqlConn.Close()

    StockNoLabel.Text = dt.Rows(0).Item('StockNo')
    MakeLabel.Text = dt.Rows(0).Item('Make')
    ModelLabel.Text = dt.Rows(0).Item('Model')
    ModelYrLabel.Text = dt.Rows(0).Item('ModelYr')
    ColorLabel.Text = dt.Rows(0).Item('Color')
    ConversionLabel.Text = dt.Rows(0).Item('Conversion')
    VinLabel.Text = dt.Rows(0).Item('Vin')
    MilesLabel.Text = dt.Rows(0).Item('Miles')
    TypeLabel.Text = dt.Rows(0).Item('Type')
    NewOrUsedLabel.Text = dt.Rows(0).Item('NewOrUsed')
    RegPriceLabel.Text = dt.Rows(0).Item('RegPrice')
    ShortDescLabel.Text = dt.Rows(0).Item('ShortDesc')
    LongDescLabel.Text = dt.Rows(0).Item('LongDesc')
    LocationLabel.Text = dt.Rows(0).Item('Location')
    SoldLabel.Text = dt.Rows(0).Item('Sold')
    SoldToLabel.Text = dt.Rows(0).Item('SoldTo')
    CommentsLabel.Text = dt.Rows(0).Item('Comments')
    Date_ReceivedLabel.Text = dt.Rows(0).Item('Date_Received')
    InService_DateLabel.Text = dt.Rows(0).Item('InService_Date')
    Image1.ImageUrl = dt.Rows(0).Item('Picture1')
    Image2.ImageUrl = dt.Rows(0).Item('Picture2')
    Image3.ImageUrl = dt.Rows(0).Item('Picture3')
    Image4.ImageUrl = dt.Rows(0).Item('Picture4')
    PostToWebCheckBox.Checked = dt.Rows(0).Item('PostToWeb')
    SpecialCheckBox.Checked = dt.Rows(0).Item('Special')
    ArchivedCheckBox.Checked = dt.Rows(0).Item('Archived')


    Front End:

    Picture1:
    <asp:Image ID='Image1' runat='server' Height='100px' ImageUrl='<%# Eval('Picture1') %>' />
    Picture2:
    <asp:Image ID='Image2' runat='server' Height='100px' ImageUrl='<%# Eval('Picture2') %>' />
    Picture3:
    <asp:Image ID='Image3' runat='server' Height='100px' ImageUrl='<%# Eval('Picture3') %>' />
    Picture4:
    <asp:Image ID='Image4' runat='server' Height='100px' ImageUrl='<%# Eval('Picture4') %>' />

    help! Thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Check the HTML source on the firefox may lead you to a solution.


    Do you have the URL? I can take a peek as well.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Here is the source code from firefox:


    <table align="center" style="width: 487px">
    <tr>
    <td align="left">
    Picture1:</td>
    <td align="left">
    <img id="ctl00_ContentPlaceHolder1_Image1" src="\pics\Test5.jpg" style="width:100px;border-width:0px;" /></td>
    <td align="left">
    Picture2:</td>
    <td align="left">
    <img id="ctl00_ContentPlaceHolder1_Image2" src="\pics\Test6.jpg" style="width:100px;border-width:0px;" /></td>
    </tr>
    <tr>
    <td align="left">
    Picture3:</td>
    <td align="left">
    <img id="ctl00_ContentPlaceHolder1_Image3" src="\pics\Test7.gif" style="width:100px;border-width:0px;" /></td>
    <td align="left">
    Picture4:</td>
    <td align="left">
    <img id="ctl00_ContentPlaceHolder1_Image4" src="\pics\Test8.gif" style="width:100px;border-width:0px;" /></td>
    </tr>
    </table>

    I don't see anything wrong from this standpoint. Again, it's working fine in IE. Here is the URL:

    http://www.mcmobilitysystems.com/vehicleadmin/VehicleDetails.aspx?ID=NC061443

    Any direction would be appreciated. Thanks.
     
  4. You should change the image paths to use forward slashes instead of backslash. For example, "/pics/Test1.jpg".

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. That fixed it! Thanks!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page