AJAX PopupcontrolExtender TargetControlID ??? Formview textbox?

J

jobs

1. How can I point the targetControlID of PopulcontrolExtender to the
textbox of a formview?

2. How can I use the same Popup for muliple date textboxes on muliple
forms?



The below code, taken from some codeproject sample, works when it's a
single simple textbox.



I get this error with a formview textbox? Is there a way to qualify in
the markup?

The TargetControlID of 'PopupControlExtender1' is not valid. A control
with ID 'StartDateTextBox' could not be found.


<cc1:popupControlExtender ID="PopupControlExtender1" runat="server"
TargetControlID="RateFormview.StartDateTextBox" PopupControlID="Panel1"
Position="Bottom" />
<asp:panel ID="Panel1" runat="server" CssClass="popupControl">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server"
BackColor="White" BorderColor="#999999" CellPadding="1"
DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="DatePicker">
</asp:Calendar>
</center>
</ContentTemplate>
</asp:UpdatePanel>
</asp:panel>

== codebehind.

Sub DatePicker(ByVal sender As System.Object, ByVal e As
System.EventArgs)

PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString())
End Sub
 
J

jobs

I can't close the calendar unless I select the date. I can't get it to
work at all unless the script manager is in each template of each
formview.

And, because I have the scriptmanger in more than one place, when I
switch modes I get an error about not being allowed to have more than
one scriptmager.

if take the script manager out of the formview, I the panel/calendar
shows is visible before I select ethe field and the pop calendar does
not work.

I tried CSS on the panel to change the visiblity and it has not helped.
It flashes on when I first load the page.

Do you have any working code of a popupcontrolExtender working with
formview items? Ideally with a scriptmanager in a master page?

what release are you on? Beta 2? When you installed the toolkit, did
you install beta and ctp first?

Thanks!

My best code looks like this:

<EditItemTemplate>



<asp:ScriptManager ID="AjaxFormviewinsert" runat="server">



</asp:ScriptManager>







.... binding fields







<asp:TextBox ID="StartDateTextBox" runat="server" Text='<%#
Bind("StartDate")%>'>


</asp:TextBox><br />



<cc1:popupControlExtender ID="SPopup" runat="server"
TargetControlID="StartDateTextbox"


PopupControlID="StartDatePanel" Position="Right" />



<asp:panel ID="StartDatePanel" runat="server" CssClass="popup">



<asp:UpdatePanel ID="StartDateUpdatePanel" runat="server">



<contenttemplate>



<center>



<asp:Calendar ID="CESCalendar" runat="server" SkinID="DatePicker"
OnSelectionChanged="DatePicker">


</asp:Calendar>



</center>



</contenttemplate>



</asp:UpdatePanel>



</asp:panel>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top