AJAX PopupExtender Not Working with Label

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 />
<asp:panel 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>
</asp:panel>
<br />
<cc1:popupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1:popupControlExtender>

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();
}
 
L

Lloyd Sheen

sling blade said:
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 />
<asp:panel 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>
</asp:panel>
<br />
<cc1:popupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1:popupControlExtender>

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 got past your error. You can define the CommitProperty as Text. Now it
did no good as I just changed the sample web site provided by toolkit to add
a label with text="Testing". I used Developer toolbar to check the text and
guess what. It is a span and there is no text. I then clicked and up
popped the calendar. Chose a date and then check again with toolbar. Now
the text property is visible with the selected date.

No error and no change to the text.

Maybe this will get you going.

LS
 
L

Lloyd Sheen

Lloyd Sheen said:
sling blade said:
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 />
<asp:panel 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>
</asp:panel>
<br />
<cc1:popupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1:popupControlExtender>

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 got past your error. You can define the CommitProperty as Text. Now
it did no good as I just changed the sample web site provided by toolkit
to add a label with text="Testing". I used Developer toolbar to check the
text and guess what. It is a span and there is no text. I then clicked
and up popped the calendar. Chose a date and then check again with
toolbar. Now the text property is visible with the selected date.

No error and no change to the text.

Maybe this will get you going.

LS

I tried with a button and a CommitProperty as "Value" and that worked. Of
course I had to perform the other example (with the Reminder Message) before
it would work. When I used the toolbar with Label and Value I could see the
value property as the selected date but of course it did not show in the
page. Perhaps MS would like us to distribute the Developer toolbar to each
customer so they can see the selected value??

LS
 
S

sling blade

sling blade said:
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 />
<asp:panel 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>
</asp:panel>
<br />
<cc1:popupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1:popupControlExtender>
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 got past your error. You can define the CommitProperty as Text. Now
it did no good as I just changed the sample web site provided by toolkit
to add a label with text="Testing". I used Developer toolbar to check the
text and guess what. It is a span and there is no text. I then clicked
and up popped the calendar. Chose a date and then check again with
toolbar. Now the text property is visible with the selected date.
No error and no change to the text.
Maybe this will get you going.

I tried with a button and a CommitProperty as "Value" and that worked. Of
course I had to perform the other example (with the Reminder Message) before
it would work. When I used the toolbar with Label and Value I could see the
value property as the selected date but of course it did not show in the
page. Perhaps MS would like us to distribute the Developer toolbar to each
customer so they can see the selected value??

LS

Progress!

I've changed the CommitScript to :
CommitScript="document.getElementById('MyLabel').innerHTML=e.value;"

and it changes the value of the label to 'undefined'.

Any clues as to whats going wrong?
 
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 />
<asp:panel 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>
</asp:panel>
<br />
<cc1:popupControlExtender ID="PopupControlExtender1"
runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
</cc1:popupControlExtender>
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 got past your error. You can define the CommitProperty as Text. Now
it did no good as I just changed the sample web site provided by toolkit
to add a label with text="Testing". I used Developer toolbar to check the
text and guess what. It is a span and there is no text. I then clicked
and up popped the calendar. Chose a date and then check again with
toolbar. Now the text property is visible with the selected date.
No error and no change to the text.
Maybe this will get you going.
LS
I tried with a button and a CommitProperty as "Value" and that worked. Of
course I had to perform the other example (with the Reminder Message) before
it would work. When I used the toolbar with Label and Value I could see the
value property as the selected date but of course it did not show in the
page. Perhaps MS would like us to distribute the Developer toolbar to each
customer so they can see the selected value??

Progress!

I've changed the CommitScript to :
CommitScript="document.getElementById('MyLabel').innerHTML=e.value;"

and it changes the value of the label to 'undefined'.

Any clues as to whats going wrong?

I found it, I had changed the CommitProperty to "text", I changed it
back to "value" and it works now!

Thanks for your help you guys!!
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top