An exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c

Last Reply on Mar 18, 2016 01:39 AM By alibasha

Posted on Mar 16, 2016 05:36 AM

Hello,

            I dont understand why I am getting this issue even there is no type/data conversion error in my code. I just converted from 2.0 to 4.0 and with latest third party controls. I am getting the exception in the master page (design) exactly in the <td> which is given below. Please help

 MainMaster.master

 </tr>
                                    <tr> 
                                        <td class="banner" style="background-image: url(<%= LeftBorder() %>);">&nbsp;</td> 

Code Behind

 

Protected ReadOnly Property LeftBorder() As String
        Get
            Return ResolveUrl(LeftBorderSrc)
        End Get
    End Property

 

Private Const LeftBorderSrc As String = _
            "~/Images/MasterPages/LeftBorder.gif"

 

Posted on Mar 16, 2016 07:26 AM Modified on on Mar 16, 2016 07:26 AM

Hi,

I am not getting such error on the Page,

I would suggest try the same on other page

HTML

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="banner" style="background-image: url(<%= LeftBorder() %>);">
            &nbsp;
        </td>
    </tr>
</table>

VB

Private Const LeftBorderSrc As String = _
        "~/Images/MasterPages/LeftBorder.gif"
Protected ReadOnly Property LeftBorder() As String
    Get
        Return ResolveUrl(LeftBorderSrc)
    End Get
End Property