troubleshooting Question

using a function getting BC30451 error

Avatar of duppypog
duppypogFlag for United States of America asked on
7 Comments4 Solutions360 ViewsLast Modified:
I'm still coding in VS 2003, ASP.NET 1.1 because I work in the public sector and we have no money for training. I have one line of code, that calls one function that already works perfectly in other applications, but I cannot find one difference to figure out why it's not working here. The code uses a function to return an image.

The .apsx page reads:
<asp:Image Runat="server" Width="100" AlternateText="Photo Unavailable" ImageUrl='<%# GetImg(Container.DataItem("ImageID")) %>' ID="Image1" ></asp:Image>

The Function looks like this:
    Public Function GetImg(ByVal sImg As Object) As String
            With sImg
                If sImg Is DBNull.Value Then
                    sImg = "Imgs\nophoto.gif"
                    sImg = "" & sImg & ".jpg"
                    'Response.ContentType = "image/jpeg"
                End If
            End With
            Return sImg
            lblError.Text = sImg
        Catch ex As Exception
            lblError.Text = ex.ToString
        End Try
    End Function

Does anyone see any reason why this would not work like in the other apps???
Thank you!

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros