locked
Issue with Pop Up Boxes sometimes not working RRS feed

  • Question

  • User-1540225444 posted

    Using ASP. Net 2008 with c# & PIUControls for a Risk Picker and Date Picker.

    Occasionaly on some pc's we have an issue where both of these pop up boxes do not work.  We are using Internet Explorer 11.

    Most of the time one of the following things fixes the issue (Deleting the browsing history, Turning on the 'Compatibility View Settings', or Turning on 'Enterprise Mode')

    However on the odd occasion this does not work.

    The code for this is as follows:

    <tr>

    <td class="fieldLabel" >

    <asp:label id="lblInitialRisk" runat="server"> Initial Risk Assessment</asp:label>

    <a href="javascript:help_create('Current_Risk_Rating')"> <img alt="" src="images/question_mark_icon.gif" border="0" /> </a><br />

    <asp:HyperLink id="link1" runat="server" Text="NSW Health Risk Matrix" NavigateUrl="~/NSW_Health_Risk_Matrix_with_LHN_delegation.pdf" Target="_blank" /> <br />

    <asp:RequiredFieldValidator ID="vldInitialRisk" ValidationGroup="Risk" runat="server"

    ErrorMessage="Current Risk Rating must be entered" ControlToValidate="tbxInitialRisk" Font-Bold="True" Display="Dynamic" EnableClientScript="False">Current Risk Rating must be entered</asp:RequiredFieldValidator>

    </td>

    <td class="fieldValue" >

    <PIUControlsX:RiskPicker ID="rpInitialRisk" runat="server" OnClick="tbxInitialRisk" EnableViewState="false" />

    <asp:TextBox ID="tbxInitialRisk" CssClass ="hidden" runat="server"

    OnTextChanged="Priority_Changed" />

     <asp:label id="lblPriority" runat="server" >NSW Health Matrix Classification: </asp:label>

    <asp:label id="lblPriorityRating" runat="server" CssClass="readOnlyValue" Width="75px"></asp:label>

    </td>

    <td class="fieldValue">

    <asp:TextBox ID="tbxCurrentRisk" CssClass="hidden" runat="server"></asp:TextBox>

    </td>

     <td class="fieldValue">

    <asp:label id="lblPriorityRating_R" runat="server" CssClass="readOnlyValue" Width="75px" Visible="false"></asp:label>

    </td>

    </tr>

    <tr>

    <td class="fieldLabel" >

    <asp:label id="lblInitialDate" runat="server">Date Risk Created</asp:label>

    <a href="javascript:help_create('Current_risk_rating_date')"> <img alt="" src="images/question_mark_icon.gif" border="0" /> </a><br />

    <asp:RequiredFieldValidator ID="vldInitialDate" runat="server" ControlToValidate="tbxInitialDate" ValidationGroup="Risk"

    ErrorMessage="Current Risk Rating Date must be entered" Display="Dynamic" Font-Bold="True">

    Current risk rating date must be entered</asp:RequiredFieldValidator>

    </td>

    <td valign="middle" >

    <PIUControls:datepicker id="dpInitialDate" runat="server" DateType="d mmm yyyy" EnableViewState="false"></PIUControls:datepicker>

    <asp:TextBox ID="tbxInitialDate" runat="server" Width="72px" CssClass="hidden" ></asp:TextBox>

    </td>

    </tr>

    I am new to this.

    Any ideas??

    Monday, February 11, 2019 4:58 AM

All replies

  • User-893317190 posted

    Hi shortsam,

    Could you tell us what you version of .net framework is  2.0,3.5 or other?

    I have searched , but I could not find   either PIUControlsX:RiskPicker  or PIUControls:datepicker, could you share your library or download link ?

    You say you are using Internet Explorer 11, have you tested other version of Internet Explorer, such as IE 7,8,9?

    IE browser could emulate IE7,8,9 , please click F12, click Emulation tab.

    If you test  other version of ie works, you could set  X-UA-compatible header.

    https://stackoverflow.com/questions/1014666/force-ie8-into-ie7-compatiblity-mode

    In addition , what the function of this js: javascript:help_create('Current_risk_rating_date')?

    Best regards,

    Ackerly Xu

    Tuesday, February 12, 2019 2:02 AM
  • User-1540225444 posted

    Hi Ackerly Xu,

    .net framework is 3.5.

    Both the PIUControls and PIUControlsX are .dll files. I am unure as how to share them.  I cannot find links to them.  They are under the references section in asp.net but I am unsure as to what library they are found in.

    The files are referenced in the system at the beginning of the page.

    <%@ Register assembly="PIUControlsX" namespace="PIUControlsX" tagprefix="PIUControlsX" %>

    <%@ Register assembly="PIUControls" namespace="PIUControls" tagprefix="PIUControls" %>

    I inherited this system and have been maintaining it.

    I'm not sure what else to tell you. I'm trying developer mode now, but as I dont have the issue and cannot reproduce it on either of my two machines its hard to know if it it work.

    Tuesday, February 12, 2019 3:44 AM
  • User-893317190 posted

    Hi shortsam,

    Without your control, I couldn't reproduce your problem.

    You could share you dll through github , please create an account and create a new repo.

    https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github-create-github-account.html

    After you have created a new repo, you could upload file,please click Upload files tab.

    In addition, I find you are using RequiredFieldValidator , please remove the control to see whether  or not RequiredFieldValidator  causes the problem.

    Best regards,

    Ackerly Xu

    Tuesday, February 12, 2019 4:20 AM
  • User-1540225444 posted

    I have created a github account and uploaded the files.  My github username is Shortsam1.

    Tuesday, February 19, 2019 2:59 AM
  • User-893317190 posted

    Hi shortsam,

    I don't know how this two controls work.

    But when I read the javascript it generates, I find two functions that the script hasn't called, so I call them manually.

    Below is my code.

        <script>
            var theForm = document.forms["form1"];
            window.onload = function () {
               // DPOnLoad();
               init()  //function for datepicker
                initRP();//function for RiskPicker
              
            }
        </script>

    The result.

    Best regards,

    Ackerly Xu

    Tuesday, February 19, 2019 5:35 AM
  • User-1540225444 posted

    Yes, this is how it works most of the time.  However, on some machines the pop up boxes occasionally dont work.  The issue is becoming more prevalent.

    Is there another way to program these pop up boxes?

    Sunday, February 24, 2019 11:48 PM
  • User-893317190 posted

    Hi shortsam,

    I don't know in what situation your control doesn't work.

    I only find  init()  and  initRP() that could init your control, about pop up the control , you could use

      popUpRiskPicker(document.all.rpInitialRisk_PIUTextBoxRP, document.all.rpInitialRisk_PIUTextBoxRP);
                popUpCalendar(document.all.dpInitialDate_PIUTextBox, document.all.dpInitialDate_PIUTextBox, 'd mmm yyyy');

    If you still  find problem, you could open f12 to see what's wrong in your program, in my case they work well.

    You could see your textbox is rendered as

    <input name="dpInitialDate$PIUTextBox" type="text" id="dpInitialDate_PIUTextBox" title="Click in text box to enter date"
    onclick="popUpCalendar(document.all.dpInitialDate_PIUTextBox, document.all.dpInitialDate_PIUTextBox, 'd mmm yyyy');"
    textchanged="Init()" readonly="true" causesvalidation="false" style="width:200px;Font-Family: Arial; Font-Size: XX-Small;">

    Please debug the Init() method and popUpCalendar method to see if there is any problem.

    It is the same with the other control.

    Best regards,

    Ackerly Xu

    Monday, February 25, 2019 1:15 AM
  • User-1540225444 posted

    I have found that when running the application on my laptop in the production environment it works fine for me.  However, when running the same code from Visual Studio 2008 while testing, the pop up boxes do not work?

    Do you know how I can investigate the difference in between what versions of Javascript, etc are running at the time.  I'm wondering if it has something to do with this.

    When I have the Developer Tools turned on, if I change the Document Mode down to 8, 7 or 5 it works.  Anything else it doesnt work.  Any ideas on how to get this working for all Document modes?

    Or even better, all Web browsers not just IE?

    Monday, February 25, 2019 3:24 AM
  • User-893317190 posted

    Hi shortsam,

    Please use chrome F12 developer tool to debug your javascript code to see whether any error shows.

    https://developers.google.com/web/tools/chrome-devtools/javascript/

    Best regards,

    Ackerly Xu

    Monday, February 25, 2019 4:03 AM