locked
Value cannot be null. Parameter name: String RRS feed

  • Question

  • User-649758194 posted

    Hi Expert,

    Please check once the error stack and advise why the error happens and what is the solution for that. I am getting lots of error like that.

    Full Stack Trace : 
    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at ASP.usercontrols_adviserprofileright_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at umbraco.presentation.templateControls.Macro.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP.masterpages_adviser_master.__Render__control6(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at umbraco.presentation.urlRewriter.FormRewriterControlAdapter.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at ASP.masterpages_adviser_master.__Render__control2(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at umbraco.presentation.masterpages._default.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at umbraco.UmbracoDefault.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Thanks in advance

    Ganesh M

    Thursday, June 28, 2018 4:52 PM

Answers

  • User-821857111 posted

    This is an umbraco site
    That means that your question is off topic here. Questions about Umbraco sites should be posted to their support forums.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 28, 2018 8:30 PM

All replies

  • User-821857111 posted

    The best solution is to use the debugger to see which line of of your actual code causes the exception. Somewhere, a value is expected but none is provided.

    Thursday, June 28, 2018 5:03 PM
  • User753101303 posted

    Hi,

    It seems your usercontrols_adviserprofileright_ascx control tries to convert a null string to an integer value.

    Thursday, June 28, 2018 5:09 PM
  • User-649758194 posted

    Thanks for your quick reply but I think the error is not related the scenario which you suggested because of the same user control render some times with same value but some times not. I think this is related to rendering issue on IIS. Please check once the full stack trace for further reference.

    Note: This is an asp.net umbraco CMS site and the site already live.

    Thanks

    Ganesh M

    Thursday, June 28, 2018 5:11 PM
  • User753101303 posted

    IIS doesn't really "render" anything. It clearly happens while ASP.NET Web Forms is rendering HTML markup to the browser. It could be that you assign a text property that is later used as an integer that from some reason it is sometimes null (for example it is taken from a Session variable and the Session expired).

    Try perhaps https://stackoverflow.com/questions/2374086/accessing-source-code-generated-from-aspx-ascx-files

    You might be able then to see the source code for the __Render__control1 method in which you should find a ParseInt32 method call.

    Thursday, June 28, 2018 5:22 PM
  • User-649758194 posted

    OK but why my stack trace not showing any line number or thread name like ControlName.XYZ().

    No __Render__control1 method exist in that control. No session on that page. No convert method on that page which will try to convert null value to int 32.

    So why the error happens?

    Thanks

    Ganesh

    Thursday, June 28, 2018 6:18 PM
  • User753101303 posted

    Source files are created from ASPX pages and ASCX controls which is then compiled. So try the earlier link to see if you can have a look at the underlying generated source code and see what happens in this __Render__control1 method. It should allow to better understand which part is causing this issue.

    Edit: or try https://blogs.msdn.microsoft.com/davidebb/2010/02/03/debugging-asp-net-generated-code/

    Thursday, June 28, 2018 6:33 PM
  • User-649758194 posted

    This is an umbraco site so no aspx page is there. Only master page with including macros (known as user control ) is there. Also checked the master page but no  __Render__control1 method found. As per your suggestion the Render__control1 should exist on adviserprofileright.ascx user control because stack trace also showing the same info like

    Value cannot be null. Parameter name: String at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at ASP.usercontrols_adviserprofileright_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

    But no method exist like that.

    Thanks

    Ganesh M

    Thursday, June 28, 2018 6:48 PM
  • User753101303 posted

    mitraganeshmitra

    no method exist like that

    Do you mean you really tried my suggestion ? Nobody wrote this code. I'm trying to explain that ASCX files are turned into source code file which is then compiled. The error happens inside this generated code...

    Thursday, June 28, 2018 7:02 PM
  • User-821857111 posted

    This is an umbraco site
    That means that your question is off topic here. Questions about Umbraco sites should be posted to their support forums.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 28, 2018 8:30 PM