Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, March 28, 2012

Dynamic generated Controls doesnt work, javascript error

I have an ajax enabled control which has a Dropdownlist that changes the Textbox when index gets changed. It is working fine if I use an ASPX page that contains the control in design time.

However, when I dynamically add this control to the ASPX in run time, I got an error when the Dropdownlist is triggered:

Javascript error: System.InvalidOperationException: A control with ID 'myDropDownList' could not be found for the trigger in UpdatePanel..etc..

What should I do? Please help..

There's a good chance that if you look at your page source you'll find that the dynamic control does not have a clientside Id of 'myDropDownList'. It'll probably have something more complex like ct100_myDropDownList or something.

Two possible fixes: 1) wire up your javascript on something other than the id (e.g. iterate over getElementsByTagName), or 2) render the control's ClientID inside a script tag on the page like: var ddl = '<%= myDropDownList.ClientID %>'

HOpe that helps.

Monday, March 26, 2012

Duplicate ID error for ReorderList in Repeater

I have a ReorderList in a Repeater and it's giving me "duplicate id" error because ReorderList is generating the same id for the DragDropBehavior. Is this a bug in ReorderList? Does someone know how to fix it temporarily in the source codes?

I think I find the fix. In ReorderList.cs ln 628, change from ID to ClientID will fix the problem.

dwp.ID =this.ClientID +"_behavior";


Hi aching,

This is related to a known issue affecting all our controls that wrap extenders. We hope to fix it pretty soon.

Thanks,
Ted

Saturday, March 24, 2012

DropShadow on PopupControl rounded corner error

I am trying to add rounded corners to my drop down calendar control but when I select rounded corners on the DropShadowExtender the calendar disappears. (http://www.mtechglobal.com/sample1.jpg)

If I set rounded corners to false, it works fine. (http://www.mtechglobal.com/sample2.jpg)

I'm also seeing a weird problem if I point the dropshadowextender to the Calendar control directly rather than the containing panel. It seems that the shadow is somehow mis-calculating the position of the control. (http://www.mtechglobal.com/sample3.jpg)

Here is my code:

<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:updatepanel id="UpdatePanel1" runat="server">
<ContentTemplate>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="txtFrom" PopupControlID="Panel1" Position="Bottom" />
</atlasToolkit:PopupControlExtender>
<atlasToolkit:DropShadowExtender ID="dse" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="dsBehavior" />
</atlasToolkit:DropShadowExtender>
<center>
<asp:Calendar ID="calFrom" runat="server" BackColor="White" BorderColor="Black" CellPadding="2" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#003399" Width="160px" OnSelectionChanged="calFrom_SelectionChanged" BorderWidth="1px" BorderStyle="Solid" >
<SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
<SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
<WeekendDayStyle BackColor="#CCCCFF" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle ForeColor="#CCCCFF" VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#99CCCC" Height="1px" ForeColor="#336666" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#003399" ForeColor="#CCCCFF" BorderColor="#3366CC" Font-Bold="True" />
<DayStyle CssClass="calDay" />
</asp:Calendar>
</center
</ContentTemplate>
</atlas:updatepanel>
</asp:Panel>
<atlasToolkit:DropShadowExtender ID="DropShadowExtender1" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="DropShadowProperties1" />
</atlasToolkit:DropShadowExtender>
Any ideas?oh and ignore the second one of these:
<atlasToolkit:DropShadowExtender ID="dse" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="dsBehavior" />
</atlasToolkit:DropShadowExtender>

cut and paste error. :)

DropShadow does not like height:auto or width:auto?

This is causing an initialize argument error when used with panel using styles either height:auto or width:auto?Since auto is the default, can you simply remove the hight/width style declarations?

Wednesday, March 21, 2012

DropDownExtender throwing 404 "File does not exist" error

I have used DropDownExtender in my projects and it works fine. However if I check the HTTP log using Web Development Helper (fromwww.nikhilk.net), I find a 404 response as it tries to get a file/resource "null" from the current folder (e.g. SampleWebSite/DropDown/null). I can get the same "error" when I run the sample web site of AjaxControlToolkit. Is this a bug? Although it works fine even with the 404 response, it bothers me because my application does catch it and log it in the event log.

Hope someone can tell me how to get rid of the 404 response.

Thanks

Edwin

Hi Edwin,

This is the internal behavior of the DropDownExtender control. The request is sent by an image element( the dropdown image ).

Initially, the img element's src is set to null, thus the browser sends a request to currentRootFolder/null for it.

When you move the mouse over it, its src is changed to a valid image ( by default, a triangle ).

When a postback happens, the img element is reinitialized to null again.

That's why you will see a 404 response.

It's not encouraged to change the source code/internal behavior of the DropDownExtender to get rid of it, because inappropriate change may bring a bigger trouble.

How do you enable logging on your application? It will be better if you can apply a filter to it. For instance, don't log the one whose request contain a url like "folderName/null"

Hope this helps.


Hi Raymond

What you described is the function of the DropDownExtender but I believe the 404 response can be avoided rather than being a "normal" occurence. I have posted the issue on codeplex (http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=11521) and hope this may help those who encountered the same problem.

Edwin

DropDownExtender positioning error

If the target control of a DropDownExtender is used in a control or div tag that has absolute, relative or fixed positioning the dropdownlist will incorrectly position below the target control.

The actual context menu will be displayed in the correct place but the hover panel that looks like a standard dropdownlist control will be displayed incorrectly. See the following link for more information and screenshot of the problemhttp://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=10075


Here is an arbitrary example. The real problem is when this control is used in third party grids that make use of relative positioning of some of their outer elements.

Has anybody else encountered this problem? Anybody know how the DropDownExtender javascript/CSS could be updated to correct this issue?

Example code

<div style="position:fixed">
<asp:Label ID="Label2" runat="server" Text="Select action"
Style="display: block; width: 100px; padding:2px; padding-right: 50px;" />
</div
<asp:Panel ID="Panel1" runat="server" CssClass="ContextMenuPanel"
Style="display :none; visibility: hidden;">
<asp:LinkButton runat="server" ID="LB1" Text="Mocha" CssClass="ContextMenuItem" />
<asp:LinkButton runat="server" ID="LB2" Text="Java" CssClass="ContextMenuItem" />
<asp:LinkButton runat="server" ID="LB3" Text="None" CssClass="ContextMenuItem" />
</asp:Panel
<ajaxToolkit:DropDownExtender runat="server" ID="DropDownExtender1" TargetControlID="Label2" DropDownControlID="Panel1" />

I'm having the same problem. It started after installing the latest build. The problem is not limited to 3rd party controls. Even the slightest modification of the Ajax dropdown example to position the target element creates this problem

Example code: -- same as dropdown example in the AJAX Samples: (For the sample, the problem occurs with either "relative" or "absolute")

<divstyle="position: relative"><asp:LabelID="TextLabel"runat="server"Text="Hover Over Me"Font-Names="Tahoma"Font-Size="11px"Style="display: block; width: 300px; padding:2px; padding-right: 50px;"/></div><asp:PanelID="DropPanel"runat="server"CssClass="ContextMenuPanel"Style="display:none;visibility:hidden;"><asp:LinkButtonrunat="server"ID="Option1"Text="Option 1"CssClass="ContextMenuItem"/><asp:LinkButtonrunat="server"ID="Option2"Text="Option 2"CssClass="ContextMenuItem"/><asp:LinkButtonrunat="server"ID="Option3"Text="Option 3 (Click Me!)"CssClass="ContextMenuItem"/></asp:Panel><ajaxToolkit:DropDownExtenderrunat="server"ID="DDE"TargetControlID="TextLabel"DropDownControlID="DropPanel"/>

DropDownExtender inside UpdatePanel = bug

Hello,

I'm abusing of the UpdatePanels, love em...

But whenever I try to put the dropdownextender inside an updatepanel I get a javascript error about an invalid padding unit?!

I'm not sure but I think it's because its inside updatepanel(s)...

Anyone seen this?

No?