473,804 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax Control Toolkit - ModalPopupExten der

SD
Hi,
I have to use the ModalPopupExten der 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;
protected AjaxControlTool kit.ModalPopupE xtender mpe;

protected override void CreateChildCont rols()
{
base.CreateChil dControls();

up = new UpdatePanel();
up.ID = "UpdatePanelTes t";
up.ChildrenAsTr iggers = false;
up.UpdateMode = UpdatePanelUpda teMode.Conditio nal;
this.Controls.A dd(up);

bt = new Button();
bt.Text = "Cliquez Ici";
bt.ID = "btModalWindow" ;
up.ContentTempl ateContainer.Co ntrols.Add(bt);

p = new Panel();
p.ID = "Panel_Test ";
p.Style.Add("DI SPLAY", "none");
p.CssClass = "modalPopup ";
p.Controls.Add( new LiteralControl( "Cliquez sur OK!<br>"));

b = new Button();
b.ID = "OkButton";
b.Text = "OK";
p.Controls.Add( b);

bc = new Button();
bc.ID = "CancelButt on";
bc.Text = "Annuler";
p.Controls.Add( bc);
up.ContentTempl ateContainer.Co ntrols.Add(p);

mpe = new AjaxControlTool kit.ModalPopupE xtender();
mpe.ID = "modal_popup_co ntrol";
mpe.PopupContro lID = p.ID;
mpe.TargetContr olID = bt.ID;
mpe.BackgroundC ssClass = "modalBackgroun d";
mpe.DropShadow = true;
mpe.OkControlID = b.ID;
mpe.CancelContr olID = bc.ID;
mpe.OnCancelScr ipt = "alert('cancel' );";
mpe.OnOkScript = "alert('OK' );";
mpe.X = 300;
mpe.Y = 300;
up.ContentTempl ateContainer.Co ntrols.Add(mpe) ;

}

/// <summary>
/// Render this Web Part to the output parameter specified.
/// </summary>
/// <param name="output"Th e HTML writer to write out to </param>
protected override void RenderWebPart(H tmlTextWriter output)
{
this.EnsureChil dControls();
up.RenderContro l(output);
}
*************** ***********
Do you see errors?
Any suggestions ?
Thanks
SD

May 3 '07 #1
0 3957

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10574
by: Not Me | last post by:
Hey, I'm using the MS AJAX libraries to achieve a modal popup window. Prior to using the toolkit control, I have a gridview and detailsview objects visible on the page.. when the gridview row is selected, the detailsview updates (in a seperate updatepanel - no full refresh) Now I've added the modalpopupextender and the result is that although the ok/cancel buttons on the panel appear.. the details within the detailview are blank...
2
5684
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, I'm having a grid view(GridView1) with a hyperlink column.It's ID is Link1 I want to show a popup on hyperlink click. I'm using ajaxToolkit:ModalPopupExtender for that. But when i'm using TargetControlID="Link1" for ajaxToolkit:ModalPopupExtender I'm getting an error System.InvalidOperationException: The TargetControlID of 'ModalPopupExtender1' is not valid. A control with ID 'Link1' could not be found.
1
1760
by: mark4asp | last post by:
Which should I use: 1. "ASP.NET AJAX-Enabled Web Site" or 2. "AJAX Control Toolkit Web Site"? In the first, controls from the control toolkit start as: <cc1:SomeControl></cc1> In the 2nd, those controls are: <ajaxToolkit:SomeControl></ ajaxToolkit>
3
2504
by: =?Utf-8?B?UnlhbiBTbWl0aA==?= | last post by:
I have a form that has a ModalPopupExtender on it. I have un updatepanel on a panel control that is displayed when an Button (outside of the update panel) is clicked. What I am trying to do is fire the updatepanel with a command like "show_first" so that I can display appropriate informaiton in the updatepanel when the Button is clicked. I need to access the Button's click event Server Side so i can show the appropriate information. I...
1
4855
by: mbruyns | last post by:
i have been trying (and sometimes succeeding) to use the modalpopupextender to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it works, displaying an awesome popup, while other times, it doesn't show a popup at all, but rather just page posts back and the panel becomes visible at the bottom of the page (where it is situated in the designer). what is even stranger to me is that...
4
6056
by: pablorp80 | last post by:
Hello, Here is what I need: I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback. Here is the problem: I am using AJAX and MasterPages as well as an update panel, the textbox is in a panel. I have tried to do it using different java scripts but I can't get it to work because I am not using asp forms, instead I am using Containers. Here is my code:...
1
5235
by: mistryman06 | last post by:
Hi, I'm new to the ASP.NET Ajax. Im struck with an issue. Im having a tabcontainer with 3 tabs. Each tab has a user control (all 3 tab has the same user control) & the user control has a Button & ModalPopup Extender. While running the application, When I click the TAB1's Button i get a modalpopup in the page. But when i select the TAB2 and click on the Button. Im not getting any modalpopup in the 2nd tab rather i see the modal popup in...
8
2746
by: Tomasz J | last post by:
Hello developers, After migrating my web project application (using the old model) to .Net Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control no longer works correctly. In certain cases (only) it renders but is dead - does not initialize. Before the migration it worked, no changes have been made. Here is the complete scenario description:
3
6964
by: Bobby Edward | last post by:
I had a simple admin form for "Categories"... Details View: To INSERT new Category Grid View: To View, Edit and Delete all Categories I decided to put the INSERT Details View inside of a ModalPopupExtender. PROBLEM 1: Dragging a ModalPopupExtender control to my webform gives me a gray box in Design View:
0
10595
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10341
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
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.