473,503 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a PopupControlExtender dynamically.

ata
Hi,
I need to create a PopupControlExtender dynamically, and attach it to
a LinkButton. i.e., when the LinkButton is clicked, I would like to
display a given literal control to the user. So, I tried the following
code:

LinkButton link = new LinkButton();
link.ID = "imgOtherAttributes" + caid;
link.CausesValidation = false;
link.Text = "other options";

LiteralControl lit2 = new LiteralControl();
lit2.ID = "popupWnd" + caid;
lit2.Text = "<div style='display:none;width:200px;height:
200px;background-color:red;'>test</div>";

AjaxControlToolkit.PopupControlExtender popup = new
AjaxControlToolkit.PopupControlExtender();
popup.ID = "popup" + caid;
popup.TargetControlID = link.ID;
popup.PopupControlID = lit2.ID;
popup.Position = AjaxControlToolkit.PopupControlPopupPosition.Right ;

However, the LiteralControl isn't shown!

Any idea?

Thanks
Jack
Jun 27 '08 #1
1 2946
did you add the new controls to the page? just creating a control will
not cause cause it to render, you must add to the page control
collection, or the collection of some container (the placeholder was
designed for this).

-- bruce (sqlwork.com)

at*@mailinator.com wrote:
Hi,
I need to create a PopupControlExtender dynamically, and attach it to
a LinkButton. i.e., when the LinkButton is clicked, I would like to
display a given literal control to the user. So, I tried the following
code:

LinkButton link = new LinkButton();
link.ID = "imgOtherAttributes" + caid;
link.CausesValidation = false;
link.Text = "other options";

LiteralControl lit2 = new LiteralControl();
lit2.ID = "popupWnd" + caid;
lit2.Text = "<div style='display:none;width:200px;height:
200px;background-color:red;'>test</div>";

AjaxControlToolkit.PopupControlExtender popup = new
AjaxControlToolkit.PopupControlExtender();
popup.ID = "popup" + caid;
popup.TargetControlID = link.ID;
popup.PopupControlID = lit2.ID;
popup.Position = AjaxControlToolkit.PopupControlPopupPosition.Right ;

However, the LiteralControl isn't shown!

Any idea?

Thanks
Jack
Jun 27 '08 #2

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

Similar topics

2
3765
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
2
4548
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
6
6079
by: Tex | last post by:
I am writting a survey system web application. I am using ASP.Net 2, C# and MS SQL 2005. I am able to store surveys and questions associated to the surveys just fine. The problem I am having is...
5
12534
by: sam | last post by:
Hi all, I am dynamically creating a table rows and inerting radio buttons which are also dynamically created. Everything works fine in Firefox as expected. But I am not able to select radio...
5
2008
by: SalamElias | last post by:
I am creating several chkBoxes dynamically and assigning an event handler in the Page_load as foillows ***************************** Dim chkCatOption As CheckBox = New CheckBox chkCatOption.Text...
10
2553
by: Jess | last post by:
Hello, If I create a temporary object using a dynamically created object's pointer, then when the temporary object is destroyed, will the dynamically created object be destroyed too? My guess...
0
1554
by: lianaent | last post by:
Hi All, I'm brand new to asp.net 2.0, and have a simple task of just creating a quick and dirty data entry form with SQL Server 2005 on the back end. I added a gridview to my form, and I can...
4
2952
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
1
4875
by: mazdotnet | last post by:
Hi all, I'm really stuck trying to figure the following out. I have been working on a shopping portal where you can select products from a list inside a repeater on the bottom of the page and...
0
7198
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,...
0
7072
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...
0
7271
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,...
1
6979
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...
0
5570
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,...
1
4998
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...
0
3160
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...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
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 ...

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.