Pass Parameters in Modal POPUP in

Posted on 2010-01-04
Last Modified: 2012-05-08
HI EE Members

We have a dynamic run time matrix of links and we want to use AJAX to select certain values usually yes / no

This is extender i am using which simply selects yes / no

 <ajaxToolkit:ModalPopupExtender ID="mpe" runat="server"
      TargetControlId="btn1"  BehaviorID="ModalPanel" OkControlID="OKButton"
      OnOkScript="stopMoving();" PopupControlID="ModalPanel"  

Attached is image so when i click on Appliable it should fetch from a databse the value Yes / No and the user should be able to select, yes / no and once he saves the values should be stored in the database

I am trying to pass values through the below code with no success

 Dim url As String = "javascript:$find('ModalPanel').show();"
                        ha.NavigateUrl = url

I want to pass MenuID and other specific parameters to do teh data Handling

Can someone suggest some expample or an easy way to do it.

Question by:mivbinfotech
    LVL 14

    Expert Comment

    i m not sure what r u trying to achieve

    i hope u know that you can call the modalpopupextender from codebehind also using;

    Please provide bit more details about your problem..
    LVL 2

    Author Comment

    ok what we want to achieve is:

    1. When we click on Applicable : It should pick up values from the Database and display in the modalpopupextender from the database,

    2.  When we click on Priority : It should pick up values from the Database in the modalpopupextender from the database,

    We can do the above in 2 separate Modal Boxes

    But we are not able to pass values from the code to the Modal and get the pag to reflect changes without a Post Back meaning page reload event

    I hope its more clear now.
    LVL 2

    Author Comment

    Can you give an example which would work it would be great

    LVL 14

    Accepted Solution

    hi sorry for delay please find the attached code if it serves ur purpose...

    you will need to add ref to ajax toolkit at top of page

        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
          <div id="divPopup" runat="server" style="width: 150px; background-color:Silver; height: 140px;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
            <br />
            <asp:Label runat="server" ID="lblMessage"></asp:Label>
        <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
        <cc1:ModalPopupExtender OkControlID="A1" CancelControlID="A2" PopupControlID="divPopup"
            TargetControlID="showpopup" ID="ModalPopupExtender1" runat="server">
        <a href="#" id="A1"></a> <a href="#" id="A2"></a>
        <a href="#" runat="server" id="showpopup">show</a>
    public partial class _Default : System.Web.UI.Page 
        protected void Page_Load(object sender, EventArgs e)
        protected void LinkButton1_Click(object sender, EventArgs e)
            lblMessage.Text = "HI testing ajax";

    Open in new window

    LVL 2

    Author Comment

    Apparantly this did the job for us partailly, but we had to redesign the page, completely, this did help a lot
    LVL 2

    Author Closing Comment

    great help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now