Ok, so I want to dynamically add a textbox and calendar extender when asked. This is a result of a specific button click within an update panel.
Action Steps;
Page Rendered
Item Selected [triggering updatepanel postback]
programmatically add textbox and extender
Private Sub CreateSingleDateControl(ByVal rItem As ReportItem, ByVal ParameterIndex As Integer, ByVal toReturn As Panel)
Dim sdate As New TextBox
Dim popup As New AjaxControlToolkit.CalendarExtender
sdate.ID = rItem.ParameterNames(ParameterIndex)
popup.TargetControlID = sdate.ID
toReturn.Controls.Add(sdate)
toReturn.Controls.Add(popup)
End Sub
Unfortunately, while the control is rendered on the page it appears that the extender is not (the javascript). I have added the same 'control' outside of the update panel on first load to ensure that the toolkit is functional and it works fine.
midnight_sun
0 Points
2 Posts
Adding extender dynamically during partial rendering
Feb 27, 2013 03:08 PM|LINK
Ok, so I want to dynamically add a textbox and calendar extender when asked. This is a result of a specific button click within an update panel.
Action Steps;
Private Sub CreateSingleDateControl(ByVal rItem As ReportItem, ByVal ParameterIndex As Integer, ByVal toReturn As Panel) Dim sdate As New TextBox Dim popup As New AjaxControlToolkit.CalendarExtender sdate.ID = rItem.ParameterNames(ParameterIndex) popup.TargetControlID = sdate.ID toReturn.Controls.Add(sdate) toReturn.Controls.Add(popup) End SubUnfortunately, while the control is rendered on the page it appears that the extender is not (the javascript). I have added the same 'control' outside of the update panel on first load to ensure that the toolkit is functional and it works fine.
Suggestions?
Steve
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Adding extender dynamically during partial rendering
Feb 28, 2013 02:20 AM|LINK
In this scenario, I would like to suggest you refer to the Following FAQ: 2.2 Dynamically creating controls
http://forums.asp.net/t/1422287.aspx#faq_v3_2_2
http://blogs.visoftinc.com/2008/02/06/dynamic-ajax-control-toolkit-calendar-extender/
http://forums.asp.net/t/1087718.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
midnight_sun
0 Points
2 Posts
Re: Adding extender dynamically during partial rendering
Mar 18, 2013 09:30 PM|LINK
Thanks for your help, I was already doing all of that.
Turns out my ID's (report parameters) had @ symbols in them. This was causing a JS exception.
Thanks!