Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Creating a PopupControlExtender dynamically.

Reply
Thread Tools

Creating a PopupControlExtender dynamically.

 
 
ata@mailinator.com
Guest
Posts: n/a
 
      06-05-2008
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
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      06-06-2008
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)

http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp:Button not firing on first click when in PopupControlExtender mazdotnet ASP .Net 1 10-02-2008 01:31 PM
Ajax PopupControlExtender john ASP .Net Web Controls 6 01-07-2008 06:54 AM
Use Image instead of text box wih the PopupControlExtender =?Utf-8?B?QVNQIERldmVsb3Blcg==?= ASP .Net 2 12-06-2006 01:50 AM
AJAX PopupcontrolExtender TargetControlID ??? Formview textbox? jobs ASP .Net 1 11-08-2006 11:41 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net 0 06-01-2005 02:36 PM



Advertisments