472,355 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,355 software developers and data experts.

How to I use the same ModalPopupExtender in different WebUserControl?

In a web page,” Default.aspx”, I have two different WebUserControl,” WebUserControl1_1”, and “WebUserControl2_1” and a ModalPopupExtender,” ModalPopupExtender1” and a Button,” Button1” and a Panel,” Panel1”. When I click the Button1, the Panel1 will pop up.

WebUserControl1_1 and WebUserControl2_1 both have a LinkButton,” LinkButton1”. I wish when user click the LinkButton1 in the WebUserControl1_1 and WebUserControl2_1, the Panel1 in the Default.aspx will pop up.

Does anyone know how to do that?
Many thanks for replying.
Any suggestion is welcome.

Following is my codes.

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication11._Default" %>
  3. <%@ Register Src="WebUserControl1.ascx" TagName="WebUserControl1" TagPrefix="uc1" %>
  4. <%@ Register Src="WebUserControl2.ascx" TagName="WebUserControl2" TagPrefix="uc2" %>
  5. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head runat="server">
  9.     <title>Untitled Page</title>
  10. </head>
  11. <body>
  12.     <form id="form1" runat="server">
  13.         <asp:ScriptManager ID="ScriptManager1" runat="server" />
  14.         <div>
  15.             <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1"
  16.                 PopupControlID="Panel1">
  17.             </cc1:ModalPopupExtender>
  18.             <asp:Button ID="Button1" runat="server" Text="Button" /></div>
  19.         <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
  20.             This is a test.</asp:Panel>
  21.         <uc1:WebUserControl1 ID="WebUserControl1_1" runat="server" />
  22.         <br />
  23.         <uc2:WebUserControl2 ID="WebUserControl2_1" runat="server" />
  24.     </form>
  25. </body>
  26. </html>
Expand|Select|Wrap|Line Numbers
  1. <%@ Control Language="C#" AutoEventWireup="true" Codebehind="WebUserControl1.ascx.cs"
  2.     Inherits="AJAXEnabledWebApplication11.WebUserControl1" %>
  3. <%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
  4.     Namespace="System.Web.UI" TagPrefix="asp" %>
  5. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  6.     <ContentTemplate>
  7.         <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
  8.     </ContentTemplate>
  9. </asp:UpdatePanel>
Expand|Select|Wrap|Line Numbers
  1. <%@ Control Language="C#" AutoEventWireup="true" Codebehind="WebUserControl2.ascx.cs"
  2.     Inherits="AJAXEnabledWebApplication11.WebUserControl2" %>
  3. <%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
  4.     Namespace="System.Web.UI" TagPrefix="asp" %>
  5. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  6.     <ContentTemplate>
  7.         <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
  8.     </ContentTemplate>
  9. </asp:UpdatePanel>
Oct 31 '07 #1
0 3048

Sign in to post your reply or Sign up for a free account.

Similar topics

by: dei1c3 | last post by:
I've created a WebUserControl which is Composite Control. It includes several controls including a few RangeValidator controls and a ValidationSummary control. The WebUserControl works properly...
by: suzi167 | last post by:
Hello Everyone, I am having the following issue. I have an AJAX enabled Web Application in C#. I am using a Master Page and then I have a Default.aspx page which is based on the Master page....
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I have a web form, and I want to use ModalPopupExtender from Ajax Toolkit. I am using IE 7.0 as browser, VS 2005 and Ajax and Ajax Tool Kit installed. Windows XP Pro. Now I have a...
by: Victor | last post by:
Hi guys i have a strange problem about my modalpopupextender. In my page, i put a gridview inside a updatepanel with paging enabled. also i put a modalpopupextender in another updatepanel to do...
by: SD | last post by:
Hi, I have to use the ModalPopupExtender prgrammatically.. But the next sample doesn't work: ************************** protected Button bt; protected Button bc; protected Button b; protected...
by: Heron | last post by:
Hi, I have a listbox (lstItems) that I want to populate with the items in another listbox (lstSelected) that's in a modalpopupextender. The update is supposed to happen when I close the...
by: mohaaron | last post by:
Hello all, I have been using the ModalPopupExtender as a way of catching errors and displaying them to users. This includes business rule violations that I catch. This all works fine as long as...
by: Peter | last post by:
I am trying to use ASP.NET Ajax Control Toolkit ModalPopupExtender which works fine, but what I am trying to do is: 1) User Clicks on the button: 2) Function on the server will check for a...
by: uicouic | last post by:
Hi all. I am having trouble getting a ModalPopupExtender to display with the corresponding data. This will be triggered by clicking on a "Details" button in a gridview. Eg. by clicking on Row1...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.