Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

AJAX PopupExtender Not Working with Label

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sling blade - 10 Apr 2008 20:52 GMT
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();
   }
Lloyd Sheen - 10 Apr 2008 23:46 GMT
> am trying to use the AJAX PopupExtender for ASP.Net 2.0.
>
[quoted text clipped - 73 lines]
>        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
Lloyd Sheen - 10 Apr 2008 23:58 GMT
>> am trying to use the AJAX PopupExtender for ASP.Net 2.0.
>>
[quoted text clipped - 86 lines]
>
> 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
sling blade - 11 Apr 2008 03:08 GMT
> >> am trying to use the AJAX PopupExtender for ASP.Net 2.0.
>
[quoted text clipped - 95 lines]
>
> 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?
sling blade - 11 Apr 2008 03:10 GMT
> > "Lloyd Sheen" <a...@b.c> wrote in message
>
[quoted text clipped - 108 lines]
>
> 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!!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.