473,569 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to I use the same ModalPopupExten der in different WebUserControl?

50 New Member
In a web page,” Default.aspx”, I have two different WebUserControl, ” WebUserControl1 _1”, and “WebUserControl 2_1” and a ModalPopupExten der,” ModalPopupExten der1” 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.

Default.aspx
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication11._Default" %>
  2.  
  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>
WebUserControl1 .ascx
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=3.5.0.0, 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>
WebUserControl2 .ascx
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=3.5.0.0, 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 3106

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

Similar topics

3
1627
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 in most situations, but I've discovered a problem when I place 2 or more of these controls on the same page. Basically, the ValidationSummary...
2
8016
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. In my Default.aspx page I am using a ModalPopUpExtender control which I have declared in teh following way:
0
3199
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 very strange problem. With 2nd line of code (DOCTYPE), I can popup modal dialog in middle of screen, BUT all my styles are lost, including modal...
1
4712
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 the edit and add new job. My problem is everytime time i change the page index in my gridview. and i click my add new button the validator in the...
0
3943
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 Panel p; protected Label lb; protected UpdatePanel up;
0
1298
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 modalpopup so I tried to add a trigger for the click event of the ok button but it seems this event is not fired anymore on serverside when it's used as the...
0
1909
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 I can write the if statement to trap the error. However this does not work in the case of un-handled exceptions. I have recently found out that...
2
3841
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 status 3) Only display ModalPopupExtender if the status is True. How do I do that, how do I display ModalPopupExtender only after postback? Is that...
0
1925
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 details button, ModalPopup will display Row1 information I suspect this might be due to the following section: protected void...
0
7704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7620
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7931
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7684
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7985
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
1230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.