locked
ValidationSummary - ShowMessageBox is not displayed in 4.6.1 RRS feed

  • Question

  • I have upgraded a large project from targetFramework="4.5" to targetFramework="4.6.1" and the ValidationSummary MessageBox is not displayed anymore. 

    If - httpRuntime targetFramework="4.6.1" - is removed from the web.config file then the MessageBox will be displayed. But this will cause many other problems.

    A ValidationSummary MessageBox is a must in applications where you don't want to use precious page space for validation / error messages.

    Anyone knowing about this problem and a workaround or correction? I suspect some settings need to be manually modified when upgrading from targetFramework="4.5" to targetFramework="4.6.1

    Lennart Hoglund

    httpRuntimetargetFramework="4.6.1"

    - turned off (removed) in the web.config file  then the MessageBox will be displayed but this will cause many other problems. A ValidationSummary MessageBox
    is a must in application where you don't want to use page space for validation messages. The same problem occurred in 4.6 and was reported.
    It worked fine in 4.5. This is stopping us from migration a big application. Any suggestion for a work-around?


    Lennart Hoglund

    • Moved by CoolDadTx Thursday, December 10, 2015 6:24 PM Wrong forums
    Wednesday, December 9, 2015 8:38 PM

All replies

  • Hi Lennart Hoglund,

    >>ValidationSummary - ShowMessageBox is not displayed in 4.6.1,

     I've checked in MSDN, ValidationSummary.ShowMessageBox Property  the highest support .NET Framework  is 4.6 and 4.5, but based on your title, your project target is 4.6.1. I am afraid there is some slip. I've also check in .Net 4.6, ValidationSummary.ShowMessageBox works fine on my side. Now I would suggest you delete the control in 4.6.1 and recreate it to test again. If you still meet the same issue. I suspect that it is not support in .Net4.6.1.   Then you should target to 4.6 and test again.

    Here is a Migration Guide to the .NET Framework 4.6 and 4.5

    https://msdn.microsoft.com/en-us/library/ff657133%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    By the way, this is a web control, your issue is related to asp.net/web technology and for a better support on this please post your question to the asp.net forum below, this forum is for C# code issues in specific:
    http://forums.asp.net/

    Hope this helps.

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    • Edited by Kristin Xie Thursday, December 10, 2015 6:07 AM
    • Proposed as answer by Just Karl Friday, December 11, 2015 4:31 PM
    Thursday, December 10, 2015 6:04 AM
  • how u perform the upgrade?

    did u change the .Net target ver in the project property? or u just merely changed the web.config?

    if u did the upgrade at the project property through VS, the web.config and other parts should be auto updated for u as well

    Thursday, December 10, 2015 6:09 AM
  • Please post questions related to ASP.NET in the ASP.NET forums (http://forums.asp.net ).
    • Proposed as answer by Just Karl Friday, December 11, 2015 4:31 PM
    Thursday, December 10, 2015 6:23 PM
  • Thanks Kristin and Kelmen for your replys.

    ValidationSummary.ShowMessageBox works fine if I create a new project in 4.6.1 and implement the same validation controls / metod as I have in my old application.

    How did I upgrade to 4.6 and 4.6.1? Well, I installed Visual Studio 2015 , framework 4.6, and opened my old application using the newly installed Visual Studio 2015. This normally, in old times, updated all project references and necessary lines in the web.config file. Not this time. I changed the properties for the project to 4.6 and also changed / updated all the project references which had not been updated. I also did the needed changes in the web.config file.

    After this the ValidationSummary.ShowMessageBox did not display, however the validation worked fine.

    I used the same procedure to upgrade to 4.6.1, hoping the problem would go away with update 1. 

    After scanning the internet for a solution I run into a suggestion that I should remove <httpRuntime targetFramework="4.6" /> line in the web.config file. Simsalabim,  the ValidationSummary.ShowMessageBox displayed. But of cource this gave problems in other areas.  


    Lennart Hoglund

    Thursday, December 10, 2015 7:05 PM
  • Thanks for your reply. Please view my previous reply.

    Yes, I believe the problem is related to the upgrade and some not performed changes to project references and maybe also the web.config file. I just can't figure out what is need to be changed. The references and the web.config file looks exactly like corresponding items in a newly created project, which works, that is ; displaying the ValidationSummary.ShowMessageBox .


    Lennart Hoglund

    Thursday, December 10, 2015 7:21 PM
  • u can try this:

    create a new web app using the intended ver, and include all dependency components

    then compare the csproj, and the package file (whatever file to contains those version detail), and *.config

    u likely gonna find some discrepancy

    vs2015 nuget manager now has a better ui to alert u about version issue, explore it

    Friday, December 11, 2015 2:58 AM
  • The problem have been solved! Upgrading a project from 4.5 to 4.6 or 4.6.1 need to include the following script in the master page ScriptManager:

    <asp:ScriptManager ID="ScriptManager_AssociationServices" runat="server" EnableScriptGlobalization="True" EnablePageMethods="True">

    <Scripts>

     <%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>

     <%--Framework Scripts--%>

    <asp:ScriptReference Name="MsAjaxBundle" />

    <asp:ScriptReference Name="jquery" />

    <asp:ScriptReference Name="bootstrap" />

    <asp:ScriptReference Name="respond" />

    <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />

    <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />

    <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />

    <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />

    <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />

    <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />

    <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />

    <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />

    <asp:ScriptReference Name="WebFormsBundle" />

     <%--Site Scripts--%>

    </Scripts>

    </asp:ScriptManager>


    This was my previous ScriptManager in the master page and it worked fine in 4.5 and below:

    <asp:ScriptManager ID="ScriptManager_AssociationServices" runat="server" EnableScriptGlobalization="True" EnablePageMethods="True">

    </asp:ScriptManager>

    The ValidationSummary MessageBox is not displayed without the script in the ScriptManager. Now I know and now I am happy.


    Best regards,

    Lennart Hoglund


    Lennart Hoglund

    • Proposed as answer by Kelmen Tuesday, December 15, 2015 2:35 AM
    Friday, December 11, 2015 12:13 PM