We help IT Professionals succeed at work.

ASP.NET- would anybody have an Idea as to what is causing me to have  I.E report - Internet Explorer cannot display the webpage

westdh
westdh used Ask the Experts™
on
Internet Explorer cannot display the webpage
   
   What you can try:
    Diagnose Connection Problems  

------------------------
the page originally displays a full page of info & images.
but if I do anything after that like click on next page or Try to login-in ...I get the above Connection error even though the Browser URL address is the orginal Page Url
-------------
If I do not display the Images everthing works paging login etc.    

what would be the cause of a browser disconnet. again the browser is still pointing to
the url of the page.

http://localhost:3126/WebSite2/Annonymous/index.aspx
 
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
Any code, or publicly accessible link to your page?

Author

Commented:
it is on a localhost:

here is the page code:
the Image I have included show the page before I login or click the pager to the next set of records.
------------
this is the code line in my page code that displays the images..  
<Rbm:RbmBinaryImage ID="Image10" runat="server" Height="100px" DisplayThumbnail="true"
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData1")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData1")) is DBNull, Nothing, Eval("ImageData1"))%>' />    
------------
if i remome this portion of the code in the above line:
ImageContent='<%#IIf(Typeof(Eval("ImageData1")) is DBNull, Nothing, Eval("ImageData1"))%>' />

the page displays without the images but then I can login and use the pager with out loosing the browser connection.

the Rbm:RbmBinaryImage control is a .dll in the bin folder

the webconfig file:
----------------------
<httpHandlers>
<add verb="GET" path="__RbmImageHandler.rbm" type="RbmControls.RbmImageHandler"/>
</httpHandlers>

My page URL: http://localhost:3126/WebSite2/Annonymous/index.aspx
which is my main & first page
runs thru a master file.

-------------
%@ Page Language="VB" MasterPageFile="~/Nested Master Pages/annonymous.master" Title="Untitled Page" %>
<%@ Register Assembly="RbmControls" Namespace="RbmControls" TagPrefix="Rbm" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.IO" %>

<script runat="server">
    
    Dim intGlobal As Integer = 0
    Dim currentUser As MembershipUser = Membership.GetUser()
    
    Public Sub Page_Load() Handles Me.Load
        
        Dim currentUser As MembershipUser = Membership.GetUser()
        'Dim pageUrl2 As String = HttpContext.Current.Request.Url.AbsoluteUri

        'Response.Write(pageUrl2)
    
    End Sub

    Public Function ShowImg(ByVal obj As Object) As Boolean
        If IsDBNull(obj) Then
            ' Do the processing here...
            ShowImg = False
        Else
            ShowImg = True
        End If
        
    End Function
    
    'Welcome: <b><%=currentUser.UserName%></b>.<br />
    'EquipmentId: <b><%=Equipment%></b>
  

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:Label ID="ErrorMessage" runat="server" EnableViewState="False" Visible="False"></asp:Label>
    
    <asp:SqlDataSource ID="indexpagedatasource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Index2PageDataSource %>" 
        
        SelectCommand="SELECT TOP (100) PERCENT E.Year, E.Make, E.Model, E.Type, E.MilesHours, E.VinSerial, E.Description, E.Location, E.Price, E.SignUpDate, 
                      UserProfile.Name, UserProfile.Company, UserProfile.Phone, UserProfile.WebsiteURL, UserProfile.Email, E.EquipmentID, 
                      GetCustomerImage_1.ImageID AS ImageID1, GetCustomerImage_1.EquipmentID AS EquipmentID1, GetCustomerImage_1.Title AS Title1, GetCustomerImage_1.ImageData AS ImageData1, GetCustomerImage_1.MIMEType AS MIMEType1,
                      GetCustomerImage_2.ImageID AS ImageID2, GetCustomerImage_2.EquipmentID AS EquipmentID2, GetCustomerImage_2.Title AS Title2, GetCustomerImage_2.ImageData AS ImageData2, GetCustomerImage_2.MIMEType AS MIMEType2,
                      GetCustomerImage_3.ImageID AS ImageID3, GetCustomerImage_3.EquipmentID AS EquipmentID3, GetCustomerImage_3.Title AS Title3, GetCustomerImage_3.ImageData AS ImageData3, GetCustomerImage_3.MIMEType AS MIMEType3, 
                      GetCustomerImage_4.ImageID AS ImageID4, GetCustomerImage_4.EquipmentID AS EquipmentID4, GetCustomerImage_4.Title AS Title4, GetCustomerImage_4.ImageData AS ImageData4, GetCustomerImage_4.MIMEType AS MIMEType4,
                      GetCustomerImage_5.ImageID AS ImageID5, GetCustomerImage_5.EquipmentID AS EquipmentID5, GetCustomerImage_5.Title AS Title5, GetCustomerImage_5.ImageData AS ImageData5, GetCustomerImage_5.MIMEType AS MIMEType5, 
                      GetCustomerImage_6.ImageID AS ImageID6, GetCustomerImage_6.EquipmentID AS EquipmentID6, GetCustomerImage_6.Title AS Title6, GetCustomerImage_6.ImageData AS ImageData6, GetCustomerImage_6.MIMEType AS MIMEType6
                      
                      FROM Equipment AS E INNER JOIN
                      UserProfile ON E.UserId = UserProfile.UserId
                      OUTER APPLY GetCustomerImage(1, E.EquipmentID) AS GetCustomerImage_1 
                      OUTER APPLY GetCustomerImage(2, E.EquipmentID) AS GetCustomerImage_2 
                      OUTER APPLY GetCustomerImage(3, E.EquipmentID) AS GetCustomerImage_3
                      OUTER APPLY GetCustomerImage(4, E.EquipmentID) AS GetCustomerImage_4
                      OUTER APPLY GetCustomerImage(5, E.EquipmentID) AS GetCustomerImage_5
                      OUTER APPLY GetCustomerImage(6, E.EquipmentID) AS GetCustomerImage_6 

                       Where E.IsLockedOut = 'False'
                      
                      GROUP BY E.Year, E.Make, E.Model, E.Type, E.MilesHours, E.VinSerial, E.Description, E.Location, E.Price, E.SignUpDate, dbo.UserProfile.Name, 
                      UserProfile.Company, UserProfile.Phone, UserProfile.WebsiteURL, UserProfile.Email, E.EquipmentID, 
                      GetCustomerImage_1.ImageID, GetCustomerImage_1.EquipmentID, GetCustomerImage_1.Title, GetCustomerImage_1.ImageData, GetCustomerImage_1.MIMEType,   
                      GetCustomerImage_2.ImageID, GetCustomerImage_2.EquipmentID, GetCustomerImage_2.Title, GetCustomerImage_2.ImageData, GetCustomerImage_2.MIMEType, 
                      GetCustomerImage_3.ImageID, GetCustomerImage_3.EquipmentID, GetCustomerImage_3.Title, GetCustomerImage_3.ImageData, GetCustomerImage_3.MIMEType,
                      GetCustomerImage_4.ImageID, GetCustomerImage_4.EquipmentID, GetCustomerImage_4.Title, GetCustomerImage_4.ImageData, GetCustomerImage_4.MIMEType, 
                      GetCustomerImage_5.ImageID, GetCustomerImage_5.EquipmentID, GetCustomerImage_5.Title, GetCustomerImage_5.ImageData, GetCustomerImage_5.MIMEType, 
                      GetCustomerImage_6.ImageID, GetCustomerImage_6.EquipmentID, GetCustomerImage_6.Title, GetCustomerImage_6.ImageData, GetCustomerImage_6.MIMEType
                      
                      ORDER BY E.SignUpDate DESC" > 
 
    </asp:SqlDataSource>
    
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="EquipmentID" DataSourceID="indexpagedatasource">
           <LayoutTemplate>
                <asp:Placeholder runat="server" ID="itemPlaceholder"></asp:Placeholder>                           
                <br />
                <br />                                    
           </LayoutTemplate>       
        <ItemTemplate>
             
            <asp:Label ID="YearLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Text='<%# Eval("Year") %>' Font-Bold="True"></asp:Label>
            <asp:Label ID="MakeLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Text='<%# Eval("Make") %>' Font-Bold="True"></asp:Label>
            <asp:Label ID="ModelLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Text='<%# Eval("Model") %>' Font-Bold="True"></asp:Label>
            <asp:Label ID="TypeLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Text='<%# Eval("Type") %>' Font-Bold="True"></asp:Label>
            &nbsp;-
            <span><asp:Label ID="PriceLabel" runat="server" 
                Font-Names="Arial" Font-Size="Small" 
                Text='<%# Eval("Price") %>' Font-Bold="True"></asp:Label>
            </span>
            <br />
            <span style="font-family:Arial; font-size:small">Miles / Hours:</span>
            <asp:Label ID="MilesHoursLabel" runat="server" Font-Names="Arial" 
                Font-Size="Small" Text='<%# Eval("MilesHours") %>'></asp:Label>
            <br />
            <span style="font-family:Arial; font-size:small">VIN / Serial No:</span>
            <asp:Label ID="VinSerialLabel" runat="server" Font-Names="Arial" 
                Font-Size="Small" Text='<%# Eval("VinSerial") %>'></asp:Label>
            <br />
            <span style="font-family:Arial; font-size:small">Description:</span>&nbsp;
            <asp:Label ID="DescriptionLabel" runat="server" Font-Names="Arial" 
                Font-Size="Small" Text='<%# Eval("Description") %>'></asp:Label>
            <br />
            <span style="font-family:Arial; font-size:small">Location:</span>&nbsp
            <asp:Label ID="LocationLabel" runat="server" Font-Names="Arial" 
                Font-Size="Small" Text='<%# Eval("Location") %>'></asp:Label>
            <br />
            <span style="font-family:Arial; font-size:small;font-weight:bold">For more info contact:</span> 
            <asp:Label ID="NameLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Font-Bold="True" Text='<%# Eval("Name") %>'></asp:Label>
               &nbsp;-
               <asp:Label ID="PhoneLabel" runat="server" Font-Names="Arial" Font-Size="Small" 
                Font-Bold="True" Text='<%# Eval("Phone") %>'></asp:Label>
                <br />
                <asp:HyperLink ID="Email" runat="server" Font-Names="Arial" 
                Font-Size="Small" NavigateURL='<%# Eval("Email") %>' 
                Text='<%# Eval("Email") %>'></asp:HyperLink>
                    <br />
                <asp:HyperLink ID="WebsiteURL" runat="server" Font-Names="Arial" 
                    Font-Size="Small" NavigateURL='<%# Eval("WebsiteURL") %>' 
                Text='<%# Eval("WebsiteURL") %>'></asp:HyperLink>
                    <br />   
                 <asp:Label ID="SignUpDate" runat="server" Font-Names="arial" 
                Font-Size="Smaller" Text='<%# Eval("SignUpDate", "{0:d}") %>'></asp:Label>
                    <br /> 
                 <br /> 

                 <Rbm:RbmBinaryImage ID="Image10" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData1")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData1")) is DBNull, Nothing, Eval("ImageData1"))%>' />          
                 <Rbm:RbmBinaryImage ID="Image20" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData2")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData2")) is DBNull, Nothing, Eval("ImageData2"))%>' />
                 <Rbm:RbmBinaryImage ID="Image30" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData3")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData3")) is DBNull, Nothing, Eval("ImageData3"))%>' />
                 <Rbm:RbmBinaryImage ID="Image40" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData4")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData4")) is DBNull, Nothing, Eval("ImageData4"))%>' />
                 <Rbm:RbmBinaryImage ID="Image50" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData5")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData5")) is DBNull, Nothing, Eval("ImageData5"))%>' />
                 <Rbm:RbmBinaryImage ID="Image60" runat="server" Height="100px" DisplayThumbnail="true" 
                  EmptyImageUrl="images/NoPhoto.JPG" Visible='<%# ShowImg(Eval("ImageData6")) %>' ImageContent='<%#IIf(Typeof(Eval("ImageData6")) is DBNull, Nothing, Eval("ImageData6"))%>' />             

        </ItemTemplate>  
        <ItemSeparatorTemplate>
        <hr />
        <br />
        </ItemSeparatorTemplate>   
     </asp:ListView>

     


    
     <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" 
        PageSize="5">
        <Fields>
            <asp:NextPreviousPagerField PreviousPageText="&lt;" ShowFirstPageButton="true"
                ShowNextPageButton="False" />
            <asp:NumericPagerField />
            <asp:NextPreviousPagerField NextPageText="&gt;" ShowLastPageButton="True" 
                ShowPreviousPageButton="False" />
        </Fields>
      </asp:DataPager>
         
</asp:Content>

Open in new window

sshot-1.png

Author

Commented:
More info
sshot-3.png
Top Expert 2015

Commented:
Just wondering if this would work:
'<%#IIf Not(Typeof(Eval("ImageData1")) is DBNull, Eval("ImageData1") , Nothing )%>'

The fact that the images display on the first go round makes me think it will not fix the problem. Looks like something is making ImageData1 DBNull after a postback. I'm not sure what Rbm:RbmBinaryImage is, but is it possible that the images are not being fetched on subsequent postbacks or maybe viewstate is handling the text data but not the image data.

Author

Commented:
darn it I was hopen But got an error

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30516: Overload resolution failed because no accessible 'IIf' accepts this number of arguments.

Source Error:

 
 ImageContent='<%#IIf Not(Typeof(Eval("ImageData1")) is DBNull, Eval("ImageData1") , Nothing )%>' />          
 
Top Expert 2015

Commented:
Since we are experimenting, try this:
'<%# If(Typeof(Eval("ImageData1")) is DBNull, Nothing, Eval("ImageData1"))%>'
Top Expert 2015

Commented:
This should also work:
'<%# If(ShowImg(Eval("ImageData1")), Eval("ImageData1"), Nothing )%>'

The thing that's bugging me is that the images show up at all, but you say this statement:
<%#IIf(Typeof(Eval("ImageData1")) is DBNull, Nothing, Eval("ImageData1"))
works on the first page load. It shouldn't! IIF is a method that accepts 3 parameters. It does not accept statements as parameters. 'Typeof(Eval("ImageData1")) is DBNull' is a statement. Plus 'DBNull' is wrong. It should be 'IsDBNull' .

Author

Commented:
Both Modification displayed the images I am using the last one becasuse it simplier.

But I am still geting the connection error when I use the pager or tried to login.

again if i remove '<%# If(ShowImg(Eval("ImageData1")), Eval("ImageData1"), Nothing )%>'
pager and login then work???
----------------
If  try to by pass the  RBMimageControl.dll . and code the httpHandler, I find every piece of sample code avail on the net always refer to query the database. I have already done that and would just like to build a method hander that would stream and display the ImagData as Conten data in the way I'm doing it now.

for each image I bring back these from the DB
GetCustomerImage_1.ImageID AS ImageID1,                            uniqueidentifier
GetCustomerImage_1.EquipmentID AS EquipmentID1,              uniqueidentifier
GetCustomerImage_1.Title AS Title1,                                        Varchar
GetCustomerImage_1.ImageData AS ImageData1,                   VarBinary
 GetCustomerImage_1.MIMEType AS MIMEType1,                   VarChar
Top Expert 2015
Commented:
I think you should stick with the RbmBinaryImage plug-in. Writing your own HTTPHandler is far more difficult. If it's displaying the images on the first page load, then the problem has to be elsewhere. You need to start setting breakpoints in your code and step through it to see what's going on. Start by setting one at the first function that gets called after clicking the pager control. I don't have the data to duplicate your project and test it on my end.

Author

Commented:
I can zip a sample and email it to you if that would be ok with you. the zip is about 9mb. ?? I would need an email in order to do it.

Author

Commented:
My email is westdh@charter.net

Author

Commented:
Thanks Much for your for all of your work I hope some how you can get it working on Visual Web Developer..
But I for now I nee d to give you credit.