Note that there are some explanatory texts on larger screens.

plurals
  1. POObject reference not set to an instance of an object when using FindControl
    primarykey
    data
    text
    <p>I am using the following code.</p> <p>.ascx file:</p> <pre><code>&lt;div class="DemoArea"&gt; &lt;asp:Button ID="btnCaseComplete" runat="server" Text="Case Complete" CssClass="btn_contentlist" onclick="btnCaseComplete_Click" OnClientClick="scroll(0,0);$.loading({mask: true, effect: 'ellipsis update'});"/&gt; &lt;ComponentArt:Dialog ID="caDropDownDialog" runat="server" Modal="true" Alignment="MiddleCentre" AllowDrag="true" AllowResize="false" AnimationDuration="1000" CloseTransition="Fade" RenderOverWindowedObjects="true" ShowTransition="Fade" AnimationType="Outline" CssClass="ModalMask"&gt; &lt;Header&gt;&lt;p class="header"&gt;Case Complete&lt;/p&gt;&lt;/Header&gt; &lt;Content&gt; &lt;asp:Panel ID="panSelectArea" runat="server" CssClass="modalMaskContent"&gt; &lt;p&gt;&lt;span class="red"&gt;Please Note:&lt;/span&gt;Once you click &lt;span class="bold"&gt;Ok&lt;/span&gt;, your case will be Submitted to ACR and you will not be able to edit the Case again. &lt;span class="style2"&gt;To continue editing the case, click &lt;/span&gt; &lt;span class="bold"&gt;Cancel&lt;/span&gt;. You will be taken back to the Case Wizard and your case will not be submitted to ACR.&lt;/p&gt; &lt;/asp:Panel&gt; &lt;/Content&gt; &lt;Footer&gt; &lt;center class="modalMaskFooter"&gt; &lt;asp:Button ID="btnOK" runat="server" CausesValidation="false" CssClass="btn_contentlist" OnClientClick="caDropDownDialog.IsShowing=false" Text="OK" /&gt; &lt;asp:Button ID="btnCancel" runat="server" CausesValidation="false" CssClass="btn_contentlist" OnClientClick="caDropDownDialog.Close();" Text="Cancel" /&gt; &lt;/center&gt; &lt;/Footer&gt; &lt;/ComponentArt:Dialog&gt; &lt;/div&gt; </code></pre> <p>Code behind:</p> <pre><code>CaseContentList obj = new CaseContentList(); // creating the object of case content list control to this page LinkButton lbtn = (LinkButton)((DataList)obj.FindControl("dlstContentList")).FindControl("lbtnDisplay"); if (lbtn.Text == "Final Page") { caDropDownDialog.IsShowing = true; } else Page.ClientScript.RegisterStartupScript(this.GetType(), "Window", "alert('Add Final Page First.');", true); </code></pre> <p>But it's giving an error 'object reference not set to an instance of an object'.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload