Showing posts with label strange. Show all posts
Showing posts with label strange. Show all posts

Monday, March 26, 2012

cc1 and cc2 prefix for controls

All --

Please help.

After upgrading from AjaxBeta2 to AjaxRC1, I now get some strange prefixes for the controls when I drag them from the Toolbox to an ASPX page, as follows...

<cc1:autocompleteextender id="AutoCompleteExtender1" runat="server" />
<cc1:dragoverlayextender id="DragOverlayExtender1" runat="server" />
<cc1:profileservice id="ProfileService1" runat="server"></cc1:profileservice>
<cc2:script id="Script1" runat="server" />
<cc1:timercontrol id="TimerControl1" runat="server"></cc1:timercontrol>
<asp:scriptmanager id="ScriptManager1" runat="server"></asp:scriptmanager>
<asp:scriptmanagerproxy id="ScriptManagerProxy1" runat="server"></asp:scriptmanagerproxy>
<asp:timer id="Timer1" runat="server"></asp:timer>
<asp:updatepanel id="UpdatePanel1" runat="server"></asp:updatepanel>
<asp:updateprogress id="UpdateProgress1" runat="server"></asp:updateprogress>

...so my question is...

Why do some controls use the expected "asp:" prefix and other use the odd "cc1:" or "cc2:" prefix?

How can this be fixed so that all controls use the same prefix, "asp:"?

Please advise.

Thank you.

-- Mark Kamoski

hello.
well, normally that is something that is defined by the programmer that builds the control through the use of the?taprefixattribute.?what's?happening?is?that?probably?the?controls?of?the?toolkit?didn't?define?that?prefix?and??now?you?get?a?default?prefix?when?you?drag?the?control?to?the?designer.

Saturday, March 24, 2012

CascadingDropDownExtender - preselected value

I used the dropdown extender a lot and noticed now a strange behavior, that makes it kind of a showstopper, if there is no workaround:

I have three DropDownLists exactly like in the example of the Toolkit. Except for the first DropDownList all values are filled in via the DropDownExtender. I did not use the optional PromptText property, because I do want to have the first value in each DropDownList preselected. This looks OK, so if I change the value of the first DropDownExtender, the values update in a cascade and the first item of each dropdown seems to be preselected - perfect. But if a postback happens now, the actual DropDownLists are empty and no value is selected, they are only selected, if the user would go on and open the drop down list and really select a value only then the values are also visible on the server side.

Is there any method I could call on the extender or on the dropdownlist to make the values visible on the server after a postback without having the user to click on the combobox and select the same value he already sees? That would be kind of hard to explain...

The behavior is easily to reproduce with the example from the Toolkit, just change in CascadingDropDown.aspx

 <table> <tr> <td>Make</td> <td><asp:DropDownList ID="DropDownList1" runat="server" Width="170" /></td> </tr> <tr> <td>Model</td> <td><asp:DropDownList ID="DropDownList2" runat="server" Width="170" /></td> </tr> <tr> <td>Color</td> <td><asp:DropDownList ID="DropDownList3" runat="server" Width="170" AutoPostBack="true" /></td> </tr> </table> <asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="DropDownList3_SelectedIndexChanged" /> <br /> <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1" Category="Make" ServicePath="CarsService.asmx" ServiceMethod="GetDropDownContents" /> <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="DropDownList2" Category="Model" ServiceMethod="GetDropDownContentsPageMethod" ParentControlID="DropDownList1" /> <ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" TargetControlID="DropDownList3" Category="Color" ServicePath="~/CascadingDropDown/CarsService.asmx" ServiceMethod="GetDropDownContents" ParentControlID="DropDownList2" />

ups... always learning... there is a "isDefault" flag on the CascadingDropDownValue collection, that just has to be set... problem solved!