S
sling blade
am trying to use the AJAX PopupExtender for ASP.Net 2.0.
I am trying to extend the example downloaded from asp.net ajax
website. The example uses a Textbox as the TargetID.
I have tried changing the TargetID to a Label on my page but I receive
the following error:
Assertion Failed: No default property supported for control ... of
type ""
It fails in this JavaScript Function:
_close : function(result) {
var e = this.get_element();if (null != result) {
if ('$$CANCEL$$' != result) {
if (this._commitProperty) {
e[this._commitProperty] = result;} else if ('text' == e.type)//Fails
here {
e.value = result;} else {
Sys.Debug.assert(false,
String.format(AjaxControlToolkit.Resources.PopupControl_NoDefaultProperty,
e.id, e.type));}
if (this._commitScript) {
eval(this._commitScript);}
}
It fails here: if ('text' == e.type) it seems that e.type is
"undefined".
Any help on replacing text in a label control using the PopupExtender
would be great!
<asp:Label ID="MyLabel" runat="server" Style="left: -542px; position:
relative; top: 32px">Northing</asp:Label>
<br />
<aspanel ID="Panel1" runat="server"
CssClass="popupControl">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="RadioButtonList1"
runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
Width="146px">
<asp:ListItem Text="Scott Guthrie"></
asp:ListItem>
<asp:ListItem Text="Simon Muzio"></
asp:ListItem>
<asp:ListItem Text="Brian Goldfarb"></
asp:ListItem>
<asp:ListItem Text="Joe Stagner"></
asp:ListItem>
<asp:ListItem Text="Shawn Nandi"></
asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
</aspanel>
<br />
<cc1opupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1opupControlExtender>
protected void RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
false)
{
// Popup result is the selected task
PopupControlExtender.GetProxyForCurrentPopup(this.Page).Commit(RadioButtonList1.SelectedValue);
}
// Reset the selected item
RadioButtonList1.ClearSelection();
}
I am trying to extend the example downloaded from asp.net ajax
website. The example uses a Textbox as the TargetID.
I have tried changing the TargetID to a Label on my page but I receive
the following error:
Assertion Failed: No default property supported for control ... of
type ""
It fails in this JavaScript Function:
_close : function(result) {
var e = this.get_element();if (null != result) {
if ('$$CANCEL$$' != result) {
if (this._commitProperty) {
e[this._commitProperty] = result;} else if ('text' == e.type)//Fails
here {
e.value = result;} else {
Sys.Debug.assert(false,
String.format(AjaxControlToolkit.Resources.PopupControl_NoDefaultProperty,
e.id, e.type));}
if (this._commitScript) {
eval(this._commitScript);}
}
It fails here: if ('text' == e.type) it seems that e.type is
"undefined".
Any help on replacing text in a label control using the PopupExtender
would be great!
<asp:Label ID="MyLabel" runat="server" Style="left: -542px; position:
relative; top: 32px">Northing</asp:Label>
<br />
<aspanel ID="Panel1" runat="server"
CssClass="popupControl">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="RadioButtonList1"
runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
Width="146px">
<asp:ListItem Text="Scott Guthrie"></
asp:ListItem>
<asp:ListItem Text="Simon Muzio"></
asp:ListItem>
<asp:ListItem Text="Brian Goldfarb"></
asp:ListItem>
<asp:ListItem Text="Joe Stagner"></
asp:ListItem>
<asp:ListItem Text="Shawn Nandi"></
asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
</aspanel>
<br />
<cc1opupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1opupControlExtender>
protected void RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
false)
{
// Popup result is the selected task
PopupControlExtender.GetProxyForCurrentPopup(this.Page).Commit(RadioButtonList1.SelectedValue);
}
// Reset the selected item
RadioButtonList1.ClearSelection();
}