I have the same probleme when I put a <asp:UpdateProgress> on my masterpage. I'm using the latest ASP.NET AJAX Control Toolkit. Hopefuly somebody have a solution, because everythings works fine before and now I got this error!!!!
Line: 1961
Char: 23
Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element
Code: 0
many thanks!!
-Pack27
Sorry i'm usingMicrosoft ASP.NET AJAX CTP Beta for the UpdateProgress...
-Pack27
Yep - I have the same issue - OK in Atlas version not in Ajax version
I'm using a gridview with hovermenu control - Note the error message does not appear in Firefox 2.0 although the layout get screwed but that another problem
The error on page message is the browser is aliitle of putting when demostrate -steve
That exception comes from the ASP.NET AJAX framework. It's basically saying that it was unable to find the element that a behavior is attached to. There's not enough info here to debug more than that. Make sure the target element is being rendered to the the page and also see the Caveat on my posting (at the top of the forum) about templates and repeaters.
Thanks
Can you provide a link to the Caveat ?
I have started to rearrange the page and just changing the layout the error has gone. it may have sometine to do with panels and visibility not sure .
I would like to understand how my changes removed the error (I know its almost impossible to share in detail what I'm doing in this forum
)- and any thoughts on why was the error not reported in Firefox?
Sorry the re-arrangement did not remove the error still searching
Found out the problem - The gridview I'm using has a number of columns which are displayed based on a checkbox - One of the columns has a HoverMenuExtender nested in the grid Itemtemplate tag . If the page tries to display itself with this column set to not visible the control throws the page error . Previous code (atlas) did not care - if the columns Visible property was set to false.
I would be interested if the Ajax team might consider returning the previous behaviour ...
I have the "Re: Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors." problem. For convenience i will name it Xerr. I'v thought that there is a problem if the popup control extender (textbox + calendar + popupcontrolextender scenario) is in a table on a user control which is used in a page having a master page (i name this scenarioSerr). Seems that is not the error appearing conditions, because this problem appears random. I'v start a new project (web site) and recreated the scenario and WORKED!. I don't understand where this problemm comes in.
I notice that the problem disappeared after i'v placed an other ScriptManager on the master page. I'v runnned again ang get normally "Only one script manager per page allowed". After that i'v deleted the second ScriptManager from the master page and Xerr never appeared again.
OBS: I think that this problemm is connected to some files/data that ScriptManager stores on the machine / available from all AjaxToolkit projects. Is there any place where the AjaxToolkit stores data common for all AjaxToolkit enabled projects on the machine? Why asking that? Because:
STEP1: I create project P1. Create the scenarioSerr. ProblemXerr appears.
STEP2: I create project P2. Create the scenarioSerr. ProblemXerr appears.
OBS: P1 and P2 absolutely identical (control, pages names) only site name differend.
STEP3: On P2 i place an extra ScriptManager on the master page.
STEP4: Run P2 and get the error that states that only one script manager allowed per page.
STEP5. Delete second script manager from P2, run P2 and the Xerr DOES NOT APPEARS ANYMORE!!!
STEP6 (The best of all): Run P1 and Xerr DOES NOT APPEAR HERE.
I have the "Re: Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors." problem. For convenience i will name it Xerr. I'v thought that there is a problem if the popup control extender (textbox + calendar + popupcontrolextender scenario) is in a table on a user control which is used in a page having a master page (i name this scenarioSerr). Seems that is not the error appearing conditions, because this problem appears random. I'v start a new project (web site) and recreated the scenario and WORKED!. I don't understand where this problemm comes in.
I notice that the problem disappeared after i'v placed an other ScriptManager on the master page. I'v runnned again ang get normally "Only one script manager per page allowed". After that i'v deleted the second ScriptManager from the master page and Xerr never appeared again.
OBS: I think that this problemm is connected to some files/data that ScriptManager stores on the machine / available from all AjaxToolkit projects. Is there any place where the AjaxToolkit stores data common for all AjaxToolkit enabled projects on the machine? Why asking that? Because:
STEP1: I create project P1. Create the scenarioSerr. ProblemXerr appears.
STEP2: I create project P2. Create the scenarioSerr. ProblemXerr appears.
OBS: P1 and P2 absolutely identical (control, pages names) only site name differend.
STEP3: On P2 i place an extra ScriptManager on the master page.
STEP4: Run P2 and get the error that states that only one script manager allowed per page.
STEP5. Delete second script manager from P2, run P2 and the Xerr DOES NOT APPEARS ANYMORE!!!
STEP6 (The best of all): Run P1 and Xerr DOES NOT APPEAR HERE.
First logical conclusion/fact about theXerr problemm (note/convention: Sys.ArgumentException: Value must not be null for Controls and Behaviors == 'Xerr'):
Scenario:
1. Run the page from APPENDIX and observe that all works just fine (right click\ViewSource... and see that there exists redered the Calendar1 control).
2. Edit the page and set Calendar1.Visible = false from IDE (design time) or from server code in Page_Load event handler.
3. Run and getXerr(right click\ViewSource... and see that there is no trace of Calendar1 control which determines that JavaScript code from WebResource.axd at line 1961 not find Calendar1, because PopupControlID of the server control PopupControlExtender1 is set to Calendar1)..
Take me to this Conclusion/Guide:
Never set visibility from server code/design attributes to the PopupControl, because ASP.NET does not renders to page output server controls marked as Visible=false.
As i'v seen on this thread, are a lot of cases which led to Xerr problemm (using usercontrols dinamically loaded in pages, datagrids, etc). I think that all the cases have in comun this thing (client side code of Ajax infrastructure does not find controls declared as PopupControlId at design time because they are not rendered.
I'd like that ASP team from Microsoft implement a bool property named RenderInvisible to Control base class.This because there can exist cases when inaccessible server code set the Visible property of the PopupControl controls, which will lead to scarry Xerr. In that way (having accessible the RenderInvisible and set it we assure that the control is rendered to html output (... style='visibility: hidden' ... )) we can avoid Xerr errors (note: Xerr errors are not only for Atlas Toolkit, they may appear even in our server controls ).
The wired thing now:
The bad news are that are cases when even i set Visible = false on a Calendar and it works. This is not logical anymore, is not it? I think that there is more than above Conclusion/Guide. If i found that i will post it here.![]()
APPENDIX:
<%
@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default2.aspx.cs"Inherits="Default2" %><%
@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %><%
@.RegisterAssembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="Microsoft.Web.UI"TagPrefix="asp" %><!
DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
htmlxmlns="http://www.w3.org/1999/xhtml"><
headrunat="server"><title>Untitled Page</title></
head><
body><formid="form1"runat="server"><div><asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager><asp:TextBoxID="TextBox1"runat="server"></asp:TextBox><asp:CalendarID="Calendar1"runat="server"></asp:Calendar></div><cc1:PopupControlExtenderID="PopupControlExtender1"runat="server"PopupControlID="Calendar1"TargetControlID="TextBox1"></cc1:PopupControlExtender></form></
body></
html>Yes, as below this is all caused by components that are not rendered by ASP.NET. For TargetControlID, we do check that the target is visible and prevent script hookup if it is not. For other Control IDs, this logic isn't in place. Doing so it a bit more complicated but we'll look into that. Good job debugging that, sorry that it wasn't clear what the issue was.
Changes to the Control base class aren't helpful here, and even if they were, a change to the Framework (System.Web.DLL) bits have to meet a very high bar at this point. This has a workaround so it would not meet that bar. If you don't have access to the server code that's setting Visible=False, you wouldn't have access to RenderInvisible either. In any case, the easy way to do this is just add "style='display:none;' to the element, which creates the correct behavior.
So your best bet is to check the Visiblility on the server side, and if it's not visible, set Enabled on the Extender to false:
if (!Calendar1.Visible) PopupControlExtender1.Enabled = false;
Thanks,
Shawn
Hey friends, I came up with a very simple solution to this problem...
I was experiencing the same problem from last 6 hours....
I just went smart and made a small change. Its explained below...
I had this thing in my file:
<!-- <cc1:AccordionID='Accordion2'runat='server'AutoSize="None"SelectedIndex="-1">
</cc1:Accordion> -->I mean the Accordion used before was commented out, and I came across this error..
After reading the posts here I realized that the AJAX Script Manager searches for the control which was on the page before and now its commented.
So to satisfy the Script Manager's hunger I removed the comments.
I replaced above code with the following code:
<cc1:AccordionID='Accordion2'runat='server'AutoSize="None"SelectedIndex="-1"></cc1:Accordion>Now, my application runs fine because the hungry Script Manager has found its beloved Accordion2...
And as I haven't wrote anything inside the Accordion it works fine, and its not shown on the page tooo..
Happy Programming guys..
Have a nice time ahead
Hi, i have same problem, i use a code that it was in comment :
<!-- <ajaxToolkit:ModalPopupExtender DropShadow="false" BackgroundCssClass="modalBackground" ID="block" runat="server" X="0" Y="300" TargetControlID="blockpanel" PopupControlID="blockpanel" ></ajaxToolkit:ModalPopupExtender>
<center>
<div style=" z-index:10000; font-family:tahoma; font-weight:bold; color:Red; font-size:14px; background-color:White; width:100%; direction:rtl; vertical-align:middle; text-align:center; " id="blockpanel" runat="server">
<center> Some TexT </center></div></center> -->
i remove it , and page load successfully,
Best regards
No comments:
Post a Comment