AJAX PopupExtender Not Working with Label

AJAX PopupExtender Not Working with Label

am 10.04.2008 21:52:39 von 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_NoDe faultProperty,
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!


Northing


CssClass="popupControl">


runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChange d"
Width="146px">
asp:ListItem>
asp:ListItem>
asp:ListItem>
asp:ListItem>
asp:ListItem>






runat="server"
CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>


protected void RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
false)
{
// Popup result is the selected task

PopupControlExtender.GetProxyForCurrentPopup(this.Page).Comm it(RadioButtonList1.SelectedValue);
}
// Reset the selected item
RadioButtonList1.ClearSelection();
}

Re: AJAX PopupExtender Not Working with Label

am 11.04.2008 00:46:09 von Courtney

"sling blade" wrote in message
news:bc365719-2db7-4430-9538-7ae8df891eee@s39g2000prd.google groups.com...
> 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_NoDe faultProperty,
> 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!
>
>
> Northing
>

> > CssClass="popupControl">
>
>
> > runat="server"
> AutoPostBack="true"
> OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChange d"
> Width="146px">
> > asp:ListItem>
> > asp:ListItem>
> > asp:ListItem>
> > asp:ListItem>
> > asp:ListItem>
>

>

>

>

>

> > runat="server"
> CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
> PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
>

>
> protected void RadioButtonList1_SelectedIndexChanged(object sender,
> EventArgs e)
> {
> if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
> false)
> {
> // Popup result is the selected task
>
> PopupControlExtender.GetProxyForCurrentPopup(this.Page).Comm it(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

Re: AJAX PopupExtender Not Working with Label

am 11.04.2008 00:58:00 von Courtney

"Lloyd Sheen" wrote in message
news:OS1Psy1mIHA.2396@TK2MSFTNGP02.phx.gbl...
>
> "sling blade" wrote in message
> news:bc365719-2db7-4430-9538-7ae8df891eee@s39g2000prd.google groups.com...
>> 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_NoDe faultProperty,
>> 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!
>>
>>
>> Northing
>>

>> >> CssClass="popupControl">
>>
>>
>> >> runat="server"
>> AutoPostBack="true"
>> OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChange d"
>> Width="146px">
>> >> asp:ListItem>
>> >> asp:ListItem>
>> >> asp:ListItem>
>> >> asp:ListItem>
>> >> asp:ListItem>
>>

>>

>>

>>

>>

>> >> runat="server"
>> CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
>> PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
>>

>>
>> protected void RadioButtonList1_SelectedIndexChanged(object sender,
>> EventArgs e)
>> {
>> if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
>> false)
>> {
>> // Popup result is the selected task
>>
>> PopupControlExtender.GetProxyForCurrentPopup(this.Page).Comm it(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

Re: AJAX PopupExtender Not Working with Label

am 11.04.2008 04:08:07 von sling blade

On Apr 11, 10:58 am, "Lloyd Sheen" wrote:
> "Lloyd Sheen" wrote in message
>
> news:OS1Psy1mIHA.2396@TK2MSFTNGP02.phx.gbl...
>
>
>
>
>
> > "sling blade" wrote in message
> >news:bc365719-2db7-4430-9538-7ae8df891eee@s39g2000prd.googl egroups.com...
> >> 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_NoDe faultProperty,
> >> 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!
>
> >> Northing
> >>

> >> > >> CssClass="popupControl">
> >>
> >>
> >> > >> runat="server"
> >> AutoPostBack="true"
> >> OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChange d"
> >> Width="146px">
> >> > >> asp:ListItem>
> >> > >> asp:ListItem>
> >> > >> asp:ListItem>
> >> > >> asp:ListItem>
> >> > >> asp:ListItem>
> >>

> >>

> >>

> >>

> >>

> >> > >> runat="server"
> >> CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
> >> PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
> >>

>
> >> protected void RadioButtonList1_SelectedIndexChanged(object sender,
> >> EventArgs e)
> >> {
> >> if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
> >> false)
> >> {
> >> // Popup result is the selected task
>
> >> PopupControlExtender.GetProxyForCurrentPopup(this.Page).Comm it(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

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?

Re: AJAX PopupExtender Not Working with Label

am 11.04.2008 04:10:20 von sling blade

On Apr 11, 2:08 pm, sling blade wrote:
> On Apr 11, 10:58 am, "Lloyd Sheen" wrote:
>
>
>
> > "Lloyd Sheen" wrote in message
>
> >news:OS1Psy1mIHA.2396@TK2MSFTNGP02.phx.gbl...
>
> > > "sling blade" wrote in message
> > >news:bc365719-2db7-4430-9538-7ae8df891eee@s39g2000prd.googl egroups.com...
> > >> 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_NoDe faultProperty,
> > >> 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!
>
> > >> Northing
> > >>

> > >> > > >> CssClass="popupControl">
> > >>
> > >>
> > >> > > >> runat="server"
> > >> AutoPostBack="true"
> > >> OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChange d"
> > >> Width="146px">
> > >> > > >> asp:ListItem>
> > >> > > >> asp:ListItem>
> > >> > > >> asp:ListItem>
> > >> > > >> asp:ListItem>
> > >> > > >> asp:ListItem>
> > >>

> > >>

> > >>

> > >>

> > >>

> > >> > > >> runat="server"
> > >> CommitScript="e.value += ' - SEND A MEETING REQUEST!';"
> > >> PopupControlID=Panel1 Position=bottom TargetControlID=MyLabel>
> > >>

>
> > >> protected void RadioButtonList1_SelectedIndexChanged(object sender,
> > >> EventArgs e)
> > >> {
> > >> if ((String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) ==
> > >> false)
> > >> {
> > >> // Popup result is the selected task
>
> > >> PopupControlExtender.GetProxyForCurrentPopup(this.Page).Comm it(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
>
> 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!!