• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2064
  • Last Modified:

Pass Parameters in Modal POPUP in ASP.net

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.


image.JPG
0
mivbinfotech
Asked:
mivbinfotech
  • 4
  • 2
1 Solution
 
amar31282Commented:
i m not sure what r u trying to achieve

i hope u know that you can call the modalpopupextender from codebehind also using
mpe.show();

Please provide bit more details about your problem..
0
 
mivbinfotechAuthor Commented:
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 ASP.net 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.
0
 
mivbinfotechAuthor Commented:
Can you give an example which would work it would be great

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
amar31282Commented:
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

<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
      <div id="divPopup" runat="server" style="width: 150px; background-color:Silver; height: 140px;">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
   
        <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
        <br />
        <asp:Label runat="server" ID="lblMessage"></asp:Label>
        
    
    </ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
    </Triggers>
    </asp:UpdatePanel>
   </div>
    
    <cc1:ModalPopupExtender OkControlID="A1" CancelControlID="A2" PopupControlID="divPopup"
        TargetControlID="showpopup" ID="ModalPopupExtender1" runat="server">
    </cc1:ModalPopupExtender>
    <a href="#" id="A1"></a> <a href="#" id="A2"></a>
    
    <a href="#" runat="server" id="showpopup">show</a>
    </form>
</body>


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

0
 
mivbinfotechAuthor Commented:
Apparantly this did the job for us partailly, but we had to redesign the page, completely, this did help a lot
0
 
mivbinfotechAuthor Commented:
great help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now