[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1921
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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