Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:17:05+00:00 2026-05-28T00:17:05+00:00

I have done a program for a pop-up using Ajax ModalPopupExtender where I will

  • 0

I have done a program for a pop-up using Ajax ModalPopupExtender where I will show a pop-up with two image buttons namely YES and NO. Now what I would like to have is when the pop-up was opened I would like to make YES Image button get selected and when ever user press Enter on YES it should take corresponding action. If the user press NO I would like to cancel and close the pop-up..

This is my design

<asp:UpdatePanel ID="updatepnl1" runat="server">
<ContentTemplate>
<asp:GridView runat="server" ID="gvDetails" CssClass="Gridview" DataKeyNames="UserId"
 AutoGenerateColumns="false">
 <HeaderStyle BackColor="#df5015" />
 <Columns>
 <asp:TemplateField HeaderStyle-BackColor="#EFF1F1" ItemStyle-HorizontalAlign="Center"
 ItemStyle-Height="25" HeaderStyle-Width="50" ItemStyle-Width="50" HeaderStyle-Font-Bold="true">
 <ItemTemplate>
   <asp:CheckBox ID="chkBoxChild" runat="server" />
 </ItemTemplate>
 </asp:TemplateField>
          <asp:BoundField DataField="UserName" HeaderText="UserName" />
          <asp:BoundField DataField="FirstName" HeaderText="FirstName" />
         <asp:BoundField DataField="LastName" HeaderText="LastName" />
    <asp:TemplateField>
      <ItemTemplate>
       <asp:ImageButton ID="btnDelete" ImageUrl="~/Images/Delete.png" runat="server" OnClick="btnDelete_Click" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Label ID="lblresult" runat="server" />
            <asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
            <ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowPopup"
                PopupControlID="pnlpopup" CancelControlID="btnNo" BackgroundCssClass="modalBackground">
            </ajax:ModalPopupExtender>
            <asp:Panel ID="pnlpopup" runat="server" BackColor="White" Height="100px" Width="400px"
                Style="display: none">
                <table width="100%" style="border: Solid 2px #999; width: 100%; height: 100%" cellpadding="0"
                    cellspacing="0">
                    <tr style="background-image: url(Images/title.gif)">
                        <td style="height: 10%; color: Black; padding: 2px; font-size: larger; font-family: Arial"
                            align="center">
                            Confirm Box
                        </td>
                        <td style="color: White; font-weight: bold; padding: 3px; font-size: larger" align="Right">
                            <a href="javascript:void(0)" onclick="closepopup()">
                                <img src="Images/x.png" style="border: 0px" align="right" /></a>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left" style="padding: 5px; font-family: Calibri">
                            <asp:Label ID="lblUser" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="padding-right: 15px">
                            <asp:ImageButton ID="btnYes" OnClick="btnYes_Click" runat="server" ImageUrl="~/Images/btnyes.jpg" />
                            <asp:ImageButton ID="btnNo" runat="server" ImageUrl="~/Images/btnNo.jpg" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

enter image description here

For the second i get this and working perfectly can any one give me solution for that Enter

function pageLoad(sender, args) {
            if (!args.get_isPartialLoad()) {
                //  add our handler to the document's
                //  keydown event
                $addHandler(document, "keydown", onKeyDown);
            }
        }

        function onKeyDown(e) {
            if (e && e.keyCode == Sys.UI.Key.esc) {
                // if the key pressed is the escape key, dismiss the dialog
                $find('ModalPopupExtender1').hide();
            }
        } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:17:05+00:00Added an answer on May 28, 2026 at 12:17 am

    After all i got the solution with the following script

    <script type="text/javascript">
    
        function pageLoad(sender, args) {
            $find('ModalPopupExtender1').add_shown(OnModalPopup);
            if (!args.get_isPartialLoad()) {
                //  add our handler to the document's
                //  keydown event
                $addHandler(document, "keydown", onKeyDown);
    
            }
        }
    
        function onKeyDown(e) {
            if (e && e.keyCode == Sys.UI.Key.esc) {
                // if the key pressed is the escape key, dismiss the dialog
                $find('ModalPopupExtender1').hide();
            }
        }
        function OnModalPopup(e) {
            $get('<%= btnYes.ClientID %>').focus();
        }
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program and as it's done now, it has a data directory
I have done one program in android using xml parsing but there is an
I have done some applet program in java, which will change the color of
I have done jQuery and Ajax, but I am not able to get the
I have done a program string[] arrExposureValues = stock.ExposureCollection[dt].Values.ToArray(); for(int i = 0; i
Preface: This is the first real swing program I have done. I have a
I have a program that convert image file to binary and also it converts
I want to pop up a window to show that a program is busy
I have done a homework assignment, here is the problem statement: Your program should
I have done up a program which requires the following: prompts user input account

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.