How to Implement Repeated Popup Messages in Asp .Net

I am currently working on an ASP.NET project where I need to incorporate choices into a popup window. The issue arises when I select the choices from the dropdown list in the popup window and click on the OK button to hide a panel and display a web form. However, after the first successful selection, when I click on the LnkBtnGet button again, the dropdownlist is visible but the button disappears. How can I troubleshoot and resolve this problem? Any help would be greatly appreciated.

Form Code

<div class="tools">
    <asp:LinkButton ID="LnkBtnGet" runat="server" ForeColor="White" Font-Bold="True" Font-Size="Medium" Text="+Add" OnClick="LnkBtnGet_Click" />
</div>

Javascript code

<script type = "text/javascript">
function BlockUI(elementID) {
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(function () {
        $("#" + elementID).block({
            message: '<table align = "center"><tr><td>' +
     '<img src="images/loadingAnim.gif"/></td></tr></table>',
            css: {},
            overlayCSS: {
                backgroundColor: '#000000', opacity: 0.6
            }
        });
    });
    prm.add_endRequest(function () {
        $("#" + elementID).unblock();
    });
}
$(document).ready(function () {

    BlockUI("<%=pnlAddEdit.ClientID %>");
    $.blockUI.defaults.css = {};
});
function Hidepopup() {
    $find("popup").hide();
    return false;
}

Panel Code:

<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" style = "display:none">
<asp:DropDownList ID="DropDownList1" Width="180px" Height="40px" runat="server"></asp:DropDownList>           
    <asp:Button Width="150px" Height="40px" ID="Button2" runat="server" Text="OK" Visible="true" OnClick="Save"></asp:Button> </table>

`

Panel Code 2

<asp:LinkButton ID="LinkButton1" runat="server" ></asp:LinkButton><cc1:ModalPopupExtender ID="popup" runat="server" DropShadow="false" PopupControlID="pnlAddEdit" TargetControlID="lnkFake" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender>

Answer №1

Change the line popup to <%=popup.ClientID %>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular Express encountering URL mismatch when retrieving files post-refresh

Currently, I am developing a small MEAN stack application. One of the features is that when an image is clicked, it displays a partial containing information about the image. Everything was working fine initially. However, after refreshing the page, Angula ...

The nested router fails to provide the next callback containing the value of 'route'

While developing a middleware handler, I ran into an interesting issue where passing the route string as an argument for the next callback resulted in a value of null. Here's an example to illustrate this: var express = require('express') ...

Ensuring that a $(function() is consistently executed and does not diminish over time

Simply put, I am troubleshooting my website and in order for it to function properly, I need to include the following code: <script type="text/javascript"> $ (function() { RESPONSIVEUI.responsiveTabs(); }); </script> What I& ...

In the test environment, only a portion of the JavaScript code is executed, but it functions properly in both the production and development environments of

Rails 3 Currently facing an issue with a list inside a form: <%= form_for @article do |f| %> <ul> <% @product.each do |p| %> <li id="product_<%=p.id%>"> <div> <%= f.radio_button(:p_id, p ...

Leverage Async/Await in React.js with the Axios Library

Recently, I came across an interesting article on Medium titled How to use async/await with axios in react The article discussed making a simple GET request to a server using Async/Await in a React.js App. The server returned a JSON object at /data with t ...

Ways to prevent the remaining time from indicating the duration

Welcome to my website. If you have any tips on creating dropdowns in markdown, please share! Here is the code snippet: // Add your JavaScript code here This script is designed to play music from a file. To use it, simply click the play button and upload a ...

Can JavaScript be used to dynamically update drop down lists in a gridview?

My gridview has multiple fields including PreviousPoints, GainedPoints, and TotalPoints. In edit mode, PreviousPoints is not editable, GainedPoints is a dropdown list, and TotalPoints is also a dropdown list. Whenever the selected value in GainedPoints ch ...

Combining JSON objects within an array

I'm working with a JSON Array that looks like this: [ {"Name" : "Arrow", "Year" : "2001" }, {"Name" : "Arrow", "Type" : "Action-Drama" }, { "Name" : "GOT", "Type" : "Action-Drama" } ] and I want to convert it to look like this: [ { "Name" : ...

How to prevent VueJS observer from monitoring a temporary variable

My VueJS and Observer objects are causing me trouble. I am encountering an issue where I assign a part of my object to a temporary variable for later use, update the original part with new data, and then revert it back to its original state after 8 seconds ...

My react-native app is having trouble with modal closure

As I develop an app, I encounter an issue with Modal usage across different screens. I have created a universal component for handling all Modals. By passing JSX and toggling visibility based on a Global variable, the problem arises when switching screens. ...

Discover the value of the textbox within a gridview row that has been checked using Jquery

I'm working with a Gridview that has checkbox and textbox columns. I need to figure out how to retrieve the value of the textbox associated with the checked row. var checkCheckBox = $("#<%=GrdV.ClientID %> [id*=chkOrder]"); $(checkCheckBox).cli ...

The 'myCtrl' parameter is invalid as it is not recognized as a function and is currently set to undefined

I'm having trouble resolving this issue. I've implemented other controllers in the same manner that are working fine, but this specific one is throwing an error Error: ng:areq Bad Argument" "Argument 'myCtrl' is not a function, got un ...

Axios failing to transmit cookie information, despite setting withCredentials to true

Exploring the capabilities of React and Express to handle requests while including cookies. The communication between client-side and server-side is successful, however, the cookies are not being transmitted. On the client-side: import axios from 'axi ...

Maintain continuous visibility of horizontal scroll in Bootstrap responsive tables

When utilizing responsive bootstrap tables in a .net web application to showcase data, the issue arises when a substantial amount of information is returned. In such cases, a horizontal scroll bar appears at the bottom of the page. This forces users to s ...

Add a data attribute to an HTML element within JSX without assigning any value

Initially, I encountered a challenge when attempting to add an attribute to a custom element/component. I found that I could only add it to non-custom elements such as div and input. https://codesandbox.io/s/react-16-966eq const dAttribute = { "data-rr-m ...

Retry request with an AngularJS interceptor

Currently, I am in the process of developing an Angular application and encountering some challenges while implementing a retry mechanism for the latest request within an HTTP interceptor. The interceptor is primarily used for authentication validation on ...

Angular 2 TypeScript: The concat() function operates as mutable within the framework

When I declare an array on an @Injectable provider, my intention is to use it across different components. normeList: any[] = [ { name: 'choice 1', type:'false' }, { name: 'choice 2', typ ...

Utilizing ng-change in an AngularJS directive with isolated scope to transition towards a component-based architecture. Let's evolve our approach

I've been struggling to get ng-change to trigger in my directive with an isolated scope. I'm working on transitioning from ng-controller to a more component-based architecture, but it's turning out to be more difficult than I anticipated. I ...

Working with jQuery, CSS, and functions to modify the current tag's class

Let's keep it brief and straightforward: Here is my HTML <div id="headerVideoControls" class="overlayElement"> <div id="videoMuteUnmute" onclick="muteUnmuteVideo('headerVideo')">mute button</div> </div> Edited ...

How can I compare the current page URL with the navigation bar?

Looking to compare the URL of a current page to an element in the navigation bar using jQuery. Started by assigning the current URL to a variable: var currentPage = window.location.href; Then utilized an .each function to loop through each item in the n ...