Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add an event handler to a control from a modal popup?
    primarykey
    data
    text
    <p>I'm programming in visual basic for the first time, and using AJAX - I've done this before but a couple of years ago and I'm very stuck! I have searched for topics but they all assume a knowledge of the framework which I think I'm missing. Any help is very much appreciated.</p> <p>Here's my markup:</p> <pre><code>&lt;%@ Page Title="Report Execution" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false" CodeBehind="reportExecution.aspx.vb" Inherits="RDMI.reportExecution" %&gt; &lt;%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %&gt; &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;h2&gt; Report Execution &lt;/h2&gt; &lt;p&gt; Welcome to the RDMI Report Execution page. Please select from the following reports: &lt;/p&gt; &lt;asp:Panel ID="panelReports" runat="server" Height="216px"&gt; &lt;asp:Button ID="btnRDMI520" runat="server" Text="Inspection Outcomes Report" BackColor="#D8D9DB" Font-Bold="True" ForeColor="#00539F" /&gt; &lt;asp:modalpopupextender id="RDMI520_popup" runat="server" cancelcontrolid="btnNo" targetcontrolid="btnRDMI520" popupcontrolid="popupPanel" popupdraghandlecontrolid="popupHeader" drag="true" backgroundcssclass="backgroundPopup" OkControlID="btnYes" /&gt; &lt;/asp:Panel&gt; &lt;span id="statusSpan" class="status"&gt;&lt;/span&gt;&lt;br /&gt; &lt;asp:Panel ID="popupPanel" style="display: none" runat="server"&gt; &lt;div class="comparisonPopup"&gt; &lt;div class="comparisonPopupHeader" id="popupHeader" style="font-size: 20px; font-weight: bold; color: #D8D9DB; background-color: #00539F" &gt;Execute Report &lt;/div&gt; &lt;div class="popupBody" style="font-size=16px; font-weight=bold;"&gt; &lt;p&gt;Would you like run this report with a comparison?&lt;/p&gt; &lt;/div&gt; &lt;div class="Controls"&gt; &lt;input id="btnYes" type="button" value="Yes" onclick="btnYes_Click"/&gt; &lt;input id="btnNo" type="button" value="No" onclick="btnNo_Click"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/asp:Panel&gt; &lt;/asp:Content&gt; </code></pre> <p>And so I want to add an event handler to the onclick events of the buttons which are in my popup box. I know I've done this before but I can't find my old code or remember how. If I need to plug in javascript to do this, any pointers to articles would be much appreciated as I'm at my wits end here!</p> <p>Obviously I have tried the obvious - </p> <pre><code>Protected Sub btnYes_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnYes.Click End Sub </code></pre> <p>This says that the 'Handles clause requires a WithEvents variable defined in the containing type or one of its base types.'</p> <p>Any assistance gratefully received and I will mark as answer if successful.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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