ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.An exception of type System.FormatException occurred in mscorlib.dll but was not handled in user cHi @alibasha,<br />Please try the following<br /><br /><a href = 'link(Threads/120495/SystemWebHttpException-occurred-in-SystemWebdll-but-was-not-handled-in-user-code/)'> System.Web.HttpException' occurred in System.Web.dll but was not handled in user code</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 05:36:14 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi,</p> <p>Will you please share your code where are you getting error</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 05:42:20 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Sure, I will share the complete code. Just to inform, exception is coming in design page (style="background-image: url(&lt;%= LeftBorder() %&gt;) ) which is frustating me.</p> <p>Details of exception..</p> <p>{"Index (zero based) must be greater than or equal to zero and less than the size of the argument list."}</p> <p>An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code</p> <p>&nbsp;</p> <pre class="brush: html">&lt;%@ Master Language=&#34;VB&#34; Inherits=&#34;Nestle.FMD.WebApp.MainMasterPage&#34; Codebehind=&#34;MainMasterPage.master.vb&#34; %&gt; &lt;%@ Register Src=&#34;../UserControls/ucFooter.ascx&#34; TagName=&#34;ucFooter&#34; TagPrefix=&#34;uc2&#34; %&gt; &lt;%@ Register Src=&#34;../UserControls/ucHeader.ascx&#34; TagName=&#34;ucHeader&#34; TagPrefix=&#34;uc1&#34; %&gt; &lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head id=&#34;HeadMasterPage&#34; runat=&#34;server&#34;&gt; &lt;title&gt;FMD&lt;/title&gt; &lt;link href=&#34;/App_Themes/FMD/Fmd.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34; /&gt; &lt;script type=&#34;text/javascript&#34; language=&#34;javascript&#34;&gt; function displayProgressBar(){ var o = document.getElementById(&#39;imgLoading&#39;); if (o != &#39;undefined&#39;){ o.style.display = &#39;block&#39;; } } &lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;../../scripts/common.js&#34;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34; onsubmit=&#34;DisplayWaiting(this)&#34;&gt; &lt;asp:ScriptManager ID=&#34;ScriptManager1&#34; runat=&#34;server&#34;&gt;&lt;/asp:ScriptManager&gt; &lt;table width=&#34;100%&#34; border=&#34;0&#34; style=&#34;height:100%;&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt; &lt;tr&gt; &lt;td id=&#34;banner&#34; valign=&#34;top&#34; colspan=&#34;2&#34;&gt; &lt;table width=&#34;100%&#34; border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;banner&#34; style=&#34;height:100%;background-image: url(&lt;%= BannerBackGroundURL() %&gt;);&#34;&gt; &lt;!--&lt;table width=&#34;100%&#34; border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;banner&#34; style=&#34;background-color:#4477b3;&#34;&gt; --&gt; &lt;tr&gt; &lt;td align=&#34;left&#34;&gt;&lt;img src=&#34;&lt;%=BannerURL() %&gt;&#34; alt=&#34;Banner&#34; id=&#34;IMG1&#34; onclick=&#34;return IMG1_onclick()&#34;/&gt;&amp;nbsp;&lt;/td&gt; &lt;!--td align=&#34;center&#34; width=&#34;100%&#34;&gt;&lt;img style=&#34;position:absolute;&#34; src=&#34;&lt;%=BannerLeftURL() %&gt;&#34;/&gt;&lt;/td--&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style=&#34;height:100%;&#34; &gt; &lt;td&gt; &lt;table width=&#34;100%&#34; border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; height=&#34;100%&#34;&gt; &lt;tr&gt; &lt;td width=&#34;50px&#34; bgcolor=&#34;#4477b3&#34;&gt;&amp;nbsp;&lt;/td&gt; &lt;td valign=&#34;top&#34;&gt; &lt;table width=&#34;100%&#34; height=&#34;100%&#34; border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt; &lt;tr&gt; &lt;td width=&#34;100%&#34; colspan=&#34;3&#34;&gt;&lt;uc1:ucHeader ID=&#34;ucHeader1&#34; runat=&#34;server&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;img src=&#34;&lt;%=LeftAngle() %&gt;&#34;/&gt;&lt;/td&gt; &lt;td class=&#34;banner&#34; width=&#34;100%&#34; style=&#34;background-image: url(&lt;%= TopBorder() %&gt;);&#34;&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class=&#34;banner&#34; style=&#34;background-image: url(&lt;%= LeftBorder() %&gt;);&#34;&gt;&amp;nbsp;&lt;/td&gt; &lt;td width=&#34;100%&#34; height=&#34;100%&#34;&gt; &lt;table width=&#34;100%&#34; border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; height=&#34;100%&#34;&gt; &lt;tr height=&#34;100%&#34;&gt; &lt;td colspan=&#34;2&#34; height=&#34;100%&#34; width=&#34;100%&#34;&gt; &lt;div id=&#34;divContent&#34; style=&#34;overflow:auto;height:100%;&#34;&gt; &lt;asp:contentplaceholder id=&#34;ContentPlaceHolder1&#34; runat=&#34;server&#34; &gt;&lt;/asp:contentplaceholder&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;img src=&#34;&lt;%=BottomAngle() %&gt;&#34;/&gt;&lt;/td&gt; &lt;td class=&#34;banner&#34; width=&#34;100%&#34; style=&#34;background-image: url(&lt;%= BottomBorder() %&gt;);&#34;&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan=&#34;3&#34;&gt; &lt;uc2:ucFooter ID=&#34;UcFooter1&#34; runat=&#34;server&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p>&nbsp;</p> <pre class="brush: vb">&#39;---------------------------------------------------------------------------------------- &#39; Copyright (C) 2007 NESTLE R&amp;D &#39; All rights reserved. &#39; Author : MAZ &#39;---------------------------------------------------------------------------------------- Imports Nestle.FMD.BusinessEntities Imports Nestle.FMD.BusinessFacade Imports Nestle.FMD.WebApp.UIProcess Imports Nestle.FMD.Common Imports System.Web.UI.WebControls Imports System.Globalization &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Application master page &#39;&#39;&#39; &lt;/summary&gt; Partial Class MainMasterPage Inherits System.Web.UI.MasterPage #Region &#34;Private constants&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Banner image &#39;&#39;&#39; &lt;/summary&gt; Private Const Banner As String = _ &#34;~/Images/MasterPages/Banner.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Banner left image &#39;&#39;&#39; &lt;/summary&gt; Private Const BannerLeft As String = _ &#34;~/Images/MasterPages/BannerLeft.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Banner back image &#39;&#39;&#39; &lt;/summary&gt; Private Const BannerBackGround As String = _ &#34;~/Images/MasterPages/BackGround2.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; left angle image &#39;&#39;&#39; &lt;/summary&gt; Private Const LeftAngleSrc As String = _ &#34;~/Images/MasterPages/LeftAngle.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; left border image &#39;&#39;&#39; &lt;/summary&gt; Private Const LeftBorderSrc As String = _ &#34;~/Images/MasterPages/LeftBorder.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Top border image &#39;&#39;&#39; &lt;/summary&gt; Private Const TopBorderSrc As String = _ &#34;~/Images/MasterPages/TopBorder.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Bottom border image &#39;&#39;&#39; &lt;/summary&gt; Private Const BottomBorderSrc As String = _ &#34;~/Images/MasterPages/BottomBorder.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; bottom angle image &#39;&#39;&#39; &lt;/summary&gt; Private Const BottomAngleSrc As String = _ &#34;~/Images/MasterPages/BottomAngle.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; separator image &#39;&#39;&#39; &lt;/summary&gt; Private Const SeparatorSrc As String = _ &#34;~/Images/MasterPages/Separator.gif&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; line separator image &#39;&#39;&#39; &lt;/summary&gt; Private Const LineSeparatorSrc As String = _ &#34;~/Images/MasterPages/LineSeparator.gif&#34; #End Region #Region &#34;Public events&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Menu delegate &#39;&#39;&#39; &lt;/summary&gt; &#39;&#39;&#39; &lt;param name=&#34;sender&#34;&gt;event sender&lt;/param&gt; &#39;&#39;&#39; &lt;param name=&#34;e&#34;&gt;event arguments&lt;/param&gt; Public Delegate Sub MainMenuEventHandler(ByVal sender As Object, _ ByVal e As EventArgs) &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Redirect to search page &#39;&#39;&#39; &lt;/summary&gt; &#39;&#39;&#39; &lt;param name=&#34;sender&#34;&gt;event sender&lt;/param&gt; &#39;&#39;&#39; &lt;param name=&#34;e&#34;&gt;event arguments&lt;/param&gt; Private Sub MainMenuSelected(ByVal sender As Object, _ ByVal e As EventArgs) Server.Transfer(PageName.Search) End Sub #End Region #Region &#34;Protected properties&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property BannerURL() As String Get Return ResolveUrl(Banner) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property BannerLeftURL() As String Get Return ResolveUrl(BannerLeft) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property BannerBackGroundURL() As String Get Return ResolveUrl(BannerBackGround) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property LeftAngle() As String Get Return ResolveUrl(LeftAngleSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property LeftBorder() As String Get Return ResolveUrl(LeftBorderSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property TopBorder() As String Get Return ResolveUrl(TopBorderSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property BottomBorder() As String Get Return ResolveUrl(BottomBorderSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property BottomAngle() As String Get Return ResolveUrl(BottomAngleSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property Separator() As String Get Return ResolveUrl(SeparatorSrc) End Get End Property &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; Image property &#39;&#39;&#39; &lt;/summary&gt; Protected ReadOnly Property LineSeparator() As String Get Return ResolveUrl(LineSeparatorSrc) End Get End Property #End Region #Region &#34;Private properties&#34; &#39;&#39;&#39; &lt;summary&gt; &#39;&#39;&#39; get the fmd page &#39;&#39;&#39; &lt;/summary&gt; Private ReadOnly Property CurrentFmdPage() As FmdPage Get Return CType(Me.Page, FmdPage) End Get End Property #End Region End Class </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 07:00:55 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi,</p> <p>I am not getting such error on the Page,</p> <p>I would suggest try the same on other page</p> <p><span style="text-decoration: underline;">HTML</span></p> <pre class="brush: html">&lt;table border=&#34;0&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt; &lt;tr&gt; &lt;td class=&#34;banner&#34; style=&#34;background-image: url(&lt;%= LeftBorder() %&gt;);&#34;&gt; &amp;nbsp; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</pre> <p><span style="text-decoration: underline;">VB</span></p> <pre class="brush: vb">Private Const LeftBorderSrc As String = _ &#34;~/Images/MasterPages/LeftBorder.gif&#34; Protected ReadOnly Property LeftBorder() As String Get Return ResolveUrl(LeftBorderSrc) End Get End Property</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 07:26:17 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hello,</p> <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Thanks for your kind reply. I would try and get back to you. Thanks.</p> <p>&nbsp;</p> <p>Best Reagrds</p> <p>Ali</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 08:49:45 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user cInstead of saying thanks mark the reply or replies(if multiple) that helped as Answer.https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Wed, 16 Mar 2016 09:23:58 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi Shashikant,</p> <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I tried with sample/test web applicatoin in the way as you have suggested. Found no issue, but please inform me why I am getting this in my actual applicatio. I would like to inform you that, this app was originally build in 2.0 framework, which I have changed to 4.0 and trying to run it. &nbsp;Thanks.</p> <p>&nbsp;</p> <p>Best Rergards</p> <p>Ali</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Thu, 17 Mar 2016 04:42:02 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi,</p> <p>Problem is not due to famework,it is just beacuse of you method not returing value</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Thu, 17 Mar 2016 05:53:52 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi,</p> <p>&nbsp; &nbsp; &nbsp; Can you able to&nbsp;help me in resolving this probelm. Thanks.&nbsp;</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Thu, 17 Mar 2016 07:50:51 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>I can give you sample and suggestion but it is not possible for me to help you remotely.</p> <p>Note: If you don't mark answers, people will lose interest in your questions.</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Thu, 17 Mar 2016 07:57:45 GMTAn exception of type System.FormatException occurred in mscorlib.dll but was not handled in user c<p>Hi,</p> <p>&nbsp;&nbsp;&nbsp; I didn&rsquo;t asked for remote help. I was asking for suggestion/guidance only. I am using this site since from 2012, if I found reply helpful, I will certainly mark it as answer. But generally, if we mark any reply as answer admin may change the question status to solved, then we cannot post further replies in that same question.</p> <p>&nbsp;However this issue has been resolved, I didn&rsquo;t observed carefully in the DOM Explorer. The problem was, HTML editor in the content page was overlapping the images of master page, thereby its throwing the exception. Thanks for all your help.</p> <p>&nbsp;</p> <p>Best Regards</p> <p>Ali</p>https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/https://www.aspforums.net:443/Threads/205001/An-exception-of-type-SystemFormatException-occurred-in-mscorlibdll-but-was-not-handled-in-user-c/Fri, 18 Mar 2016 01:39:40 GMT