Showing posts with label dropdownextender. Show all posts
Showing posts with label dropdownextender. Show all posts

Wednesday, March 21, 2012

DropDownExtender: reusing DropDownControl - is it possible?

Hello Developers,

I have a form with several input textboxes and associated drop down extenders.
Is there any way I can use one drop down control (panel with link buttons) for all of my drop down extenders?
I just hate to render drop down control multiple times when each drop down should have exactly the same selection items.

Thanks for any pointers.

Tomasz

Hi Tomasz,

My understanding of your issue is that you want to use one DropDownExtender instead of several DropDownExtenders in your situation. If I have misunderstood, please feel free to let me know.

tdjastrzebski:

Is there any way I can use one drop down control (panel with link buttons) for all of my drop down extenders?

Do you want to set its TargetControl manually? I think it is a little complex unless we modify its source code. However I found a way . We only put one DropDownExtender on the page. When click (or a mouse event) the Control, DropDownExtender will conver it and act like one another DropDownExtender works on it. Here is the sample.

<%@. Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:LinkButton ID="LinkButton1" runat="server" style="display:none">LinkButton</asp:LinkButton>
<br />
<br />

<asp:Panel ID="Panel1" runat="server" style="display:none">
123123123<br>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:Panel>
<ajaxToolkit:DropDownExtender ID="DropDownExtender1" BehaviorID="myDDEBID" runat="server" TargetControlID="LinkButton1" DropDownControlID="Panel1">
</ajaxToolkit:DropDownExtender>

<asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return false;" onmouseover="showDDE('LinkButton2','LinkButton2');">LinkButton2</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" OnClientClick="return false;" onmouseover="showDDE('LinkButton3','LinkButton3');">LinkButton3</asp:LinkButton>
<%=DateTime.Now.ToString()%>
<script type="text/javascript" language="javascript">
function showDDE(lbName,lbText){
//If you want to change the Panel's content when switch from different LinkButtons , the easiest way is to add an UpdatePanel inside the Panel.
//When onhover event is fire, first refresh the UpdatePanel by sending an asynchronous postback.
var newLocation = $common.getLocation($get(lbName));
$get("LinkButton1").innerText = lbText; //if Firefox , $get("LinkButton1").textContent = lbText;
$common.setLocation($find("myDDEBID").get_element(),new Sys.UI.Point(newLocation.x ,newLocation.y));
$get("LinkButton1").style.display='';
$find("myDDEBID").hide(); //enhance the compatible
$find("myDDEBID").hover();
}
</script>
</form>
</body>
</html>
I hope this help.

Best regards,

Jonathan


Thanks!

This solution seems to work.

Tomasz

DropDownExtender: Refresh content

I have a drop-down extender, where the control ID references a Panel, which contains a TreeView. When I update the contents of the TreeView, and hit the drop-down button, the treeview shown is not refreshed. Is there any way that I can force a refresh?

Thanks - Bennie

How are you updating the treeview?

Ron


I am adding/removing tree nodes in a public method of the treeview.


Is the TreeView in an UpdatePanel? I'm trying to determine how all of the controls in question are composed. Could you post a snippit of the aspx?


this is the DropDownExtender:

<

ajaxToolkit:DropDownExtenderrunat="server"ID="DDE"TargetControlID="bookmarksTextLabel"DropDownControlID="DropPanel"/>

This is the DropPanel:

<asp:PanelEnableViewState="false"ID="DropPanel"ForeColor="#747678"runat="server"Style="text-align:left;padding-bottom:0px;padding-top:0px;margin-bottom:0px;margin-top:0px;display:none;visibility:hidden;">

<divstyle="border-color:Blue; border-width: 1px; border-style:solid; padding: 1px,1px,1px,1px;">

<bmt:BookmarksTreeid="tvBookmarks"runat="server"/></div></asp:Panel>

I tried enabling/disabling ViewState, but to no avail.


Does it work without using the drop-down extender? Please verify that the tree is populating correctly without the extender on the page. Is all of this content within an UpdatePanel?

It does work without the DropDownExtenter. No, there is no outer UpdatePanel.

DropDownExtender: How can I set the text of downlist?

Hi,

I need your kindly help.When I try to use DropDownExtender just as following:

<asp:UpdatePanel ID="up1" runat="server" UpdateMode="Always" RenderMode="Inline">
<ContentTemplate>
<cc1:DropDownExtender ID="dropdownextender" runat="server" Enabled="true" TargetControlID="fromTime" DropDownControlID="calender" >
</cc1:DropDownExtender>
<asp:Calendar ID="calender" runat="server" OnSelectionChanged="calender_SelectionChanged" ></asp:Calendar>
<asp:DropDownList ID="fromTime" runat="server" AutoPostBack="false" Width="90%">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="calender" />
</Triggers>
</asp:UpdatePanel>

protected void calender_SelectionChanged(object sender, EventArgs e)
{
fromTime.Text = calender.SelectedDate.ToString();
}

Although I can get the SelectedDate, but formTime.Text is “”all the time.Is there anything wrong? How can I set the text?

Many Thanks&&Best Reguards

Nicorn

Resolved.Big Smile

protected void fromcalender_SelectionChanged(object sender, EventArgs e)
{
fromTime.Items.Clear();
string[] date = fromcalender.SelectedDate.ToString().Split(' ');
fromTime.Items.Add(new ListItem(date[0], date[0]));
}


Big Smile Fixed ^_^

protected void fromcalender_SelectionChanged(object sender, EventArgs e)
{
fromTime.Items.Clear();
string[] date = fromcalender.SelectedDate.ToString().Split(' ');
fromTime.Items.Add(new ListItem(date[0], date[0]));
}

DropDownExtender: Edit TextBox attached to DropDownExtender

Is there a way to edit the textbox that is attached to the dropdownextender.

1<asp:TextBox ID="txtLocation" runat="server" OnTextChanged="txt_TextChanged" />
2 <cc1:DropDownExtender ID="DropDownExtender1" runat="server" DropDownControlID="Panel1" TargetControlID="txtLocation">
3 </cc1:DropDownExtender>

I have tried adding a textbox to Panel1 but it disappears as soon as i click on it.

Marty

My guess would be that once the TextBox in the Panel receives focus, the Panel loses focus, and that causes the Extender's script to think that it should close the Panel.

It sounds like you need a Panel that doesn't auto-close and you have to manually close. That way you can do data entry on the Panel.


And how is that done?
Popup window, modal dialog, roll your own iframe or floating div...

Hi ,

I am facing same problem.Can you please tell me how can I solve it?

Many thanks,

Ramesh.


Any solution about this issue ?

DropDownExtender!

The Toolkit Example is quite simple, my scenario is I have a DropDownList which is binded to a data source! How can I add the triggers for 50+ ListItems of my DropDown?

<Triggers><asp:AsyncPostBackTriggerControlID="Option1"EventName="Click"/>

<asp:AsyncPostBackTriggerControlID="Option2"EventName="Click"/>

</Triggers>

I want to basically navigate the dropdownlist using my arrow keys on the keyboard and I have an imagePanel whose Image changes depending upon what item selection on the dropDownlist, right now if I click on the DropDownList I am able to update the ImagePanel, but I want to do this using the arrow keys...

Youre not going to be able to do this in any easy way. It is possible but if you want to make it happen you have to pump out a heap of javascript. If you still want to let me know and Ill try and point you in the right direction.

DropDownExtender Visual Question

When you hover over the dropdown element it gets a really nice khaki background, blue border, and a down image. More or less it looks like a drop down after you hover over the text.

Is there a way to get this style to be the default style? The dropdown extender is kind of misleading in that you wont know its a drop down menu till you hover over the text and expose the style that then displays it as a menu.

Any ideas?

It really depends on what you're trying to put the dropdown extender on - but generally, for something like a label, you could create an image, that looked very much like the dropdown extenders outside - and set it as the background to an appropriatly sized Div. Put the label inside the div, and apply the extender to the label.

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 question

Can I use the DropDownExtender to create a google suggest textbox? If not, is there another control i can use to do this, or do I have to build my own?

Thanks

sorry...what is google suggest textbox

http://www.google.com/webhp?complete=1&hl=en

The AutoCompleteExtender does what I want but I'm not sure how to send the textbox value to the webservice to sort the dataset. Here's my code...

 <asp:TextBox ID="txtTest" runat=server></asp:TextBox> <asp:AutoCompleteExtender ID=ace1 runat=server TargetControlID="txtTest" ServicePath="WebService.asmx" ServiceMethod="getZoneSuggestions" MinimumPrefixLength="1" />
[ScriptMethod] [WebMethod(EnableSession =true)]public string[] getZoneSuggestions(string test) {string[] result; result =new string[4]; result[0] ="atest1"; result[1] ="atest2"; result[2] ="btest2"; result[3] ="btest2";return result; }
When I try to pass the string into getZoneSuggestions nothing happens, but when I remove "string test" it will show all of my results.
 

I figured it out.

[ScriptMethod] [WebMethod(EnableSession =true)]public string[] getZoneSuggestions(String prefixText,int count) {string[] result; result =new string[4]; result[0] ="atest1"; result[1] ="atest2"; result[2] ="btest2"; result[3] ="btest2";return result; }

DropDownExtender problem

Hi all...

I have problem with DropDownExtender.

There is on the page have placed DropDownExtender and disabled TextBox Control with some text.

When I make right click on the text in disabled textbox, I get JavaScript error like "Object doesn't support this property or method". (Problem with getClientRects function in Script sources file)

Simple content page:

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp.Default" Title="Untitled Page" %><%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server"><table cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left"> <asp:Label ID="lblLinkName" runat="server" Font-Size="12px" Text="Show Links" Style="display: block; padding: 2px; padding-right: 20px; color: White;font-size:12px;font-weight:700;font-family: Verdana,Arial, MS Sans Serif, Tahoma;" /> <asp:Panel ID="DropPanel" runat="server" Style="display: none; visibility: hidden; background: White;"> <table cellpadding="2" cellspacing="0" border="0" style="width:150px; border: solid 1px Gray;"> <tr> <td><asp:LinkButton ID="lnkFirst" runat="server" Text="First Link" /></td> </tr> <tr> <td><asp:LinkButton ID="lnkSecond" runat="server" Text="Second Link" /></td> </tr> <tr> <td><asp:LinkButton ID="LinkThird" runat="server" Text="Third Link" /></td> </tr> </table> </asp:Panel> <ajaxToolkit:DropDownExtender runat="server" ID="DDE" TargetControlID="lblLinkName" DropDownControlID="DropPanel" HighlightBackColor="#256294" HighlightBorderColor="white" /> </td> </tr> <tr> <td> </td> </tr> <tr> <td><asp:TextBox ID="txtField" runat="server" Width="200" /></td> </tr></table></asp:Content>
 CodeBehind:
 
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;namespace TestApp{public partialclass Default : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e) {if (!Page.IsPostBack) { txtField.Text ="Hello World!"; txtField.Enabled =false; } } }}

Try to reproduse this bug or leave your email and I send example.

Please help.Sad

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 offset since 10201

When upgrading my toolkit dll to the latest version, all my dropdownextenders seem to render with 20 pixels margin to the left side. It's only the "dropdownbox" surrounding the textlabel: the dropdownlist itself is where it should be. Anyone else experiencing this problem? It might have to do something with my CSS, but it worked before. I've already copied the CSS from the example website, that didn't fix it (though it was different from the file I had)

Isn't anyone experiencing these problems? It probably has something to do with relative/absolute positioning or something. I wonder what changed since last release cause I didn't experience these problems before.

Which CSS class handled the dropdown position?

Dropdownextender offset problem

I use the modalPopupExtender to show a panel with a label inside. The label has a dropdownextender connected that is showing another panel.
Everything works nice until the the dropdownwxtender is triggered. The dropdownextender is offset with approx. left +2px and top +2px.
How can this be solved?

<div>
<asp:ScriptManagerID="ScriptManager1"runat="server"/>
<asp:ButtonID="Button1"runat="server"Text="Button"/>
<cc1:ModalPopupExtenderID="ModalPopupExtender1"runat="server"PopupControlID="Panel2"TargetControlID="Button1"></cc1:ModalPopupExtender>
<asp:PanelID="Panel2"runat="server">
<asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>
<asp:LabelID="Label1"runat="server"Text="Label"></asp:Label><cc1:DropDownExtenderID="DropDownExtender1"runat="server"DropDownControlID="Panel10"TargetControlID="Label1">
</cc1:DropDownExtender>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<asp:UpdatePanelID="UpdatePanel2"runat="server">
<ContentTemplate>
<asp:PanelID="Panel10"runat="server">
1<br/>
2<br/>
3
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>

Regards,
Jonas

Firefox works; IE's broken. This'll fix IE but break Firefox. Check with someone who knows CSS for a better solution.

<div style="position: relative; left: -4px; top: -4px;"> <asp:Label ID="Label1" runat="server" Text="Label"> </asp:Label></div>

I'm sorry to say that I still get the same result. (This applies to both IE and Firefox.)
It's not the label that is offset it's the graphics of the dropdownextender that is supposed to surround the label. (See image below.)


In the beta2 DropDown sample, the

TargetControlID="TextLabel"DropDownControlID="DropPanel"

have both inline styling and styling in a .css file in the App_Themes folder. Seeing as the sample works, I'd suggest applying this as a model to your code.


The beta2 DropDown sample works fine.

The problem occurrs when the DropDown is placed inside of a panel that is shown (popup) by an ModalPopupExtender.


Jonas, I have exactly the same problem. The box that encloses the text label is shifted down and to the right, 2 or 3 pixels each. Mine is not in a modal panel, but it is in a panel (that is probably in another panel in another, etc.) Unfortunately, I don't have time in this project to start taking away panels or moving out of them to see where it breaks, but I have no doubt that it would display properly if contained right in the root document panel. I have similar problems with some other toolkit extenders. Various things cause them to miscalculate their intended location, and there doesn't seem to be a way to get the affected controls' ClientID, so workarounds are limited.

Try adding the following style element to the text label (below, in bold). You may have to adjust the numbers. The four parts of thepadding value are top, right, bottom, left (clockwise from top).

<asp:LabelID="Label1"runat="server"Text="Label"Style="padding: 5px 5px 0px 5px;">

It leaves a bit of extra space at the bottom of the label, but it might work for you. It did for me. Unfortunately, I really want to use an image for the control instead of a label. Works great, but I cannot get rid of the 2px space below the image inside the drop-down control frame that is created by the extender.

If anyone knows of any tips and tricks for solving these offset problems on this and other extender controls, I'd be very grateful.

Thanks, -Brian


Let's step back a moment. And clarify. When your code was placed into the sample, I saw your reported offsets in IE, but Firefox showed no sign of having a problem with the combination. When I styled your code with 4px adjustments, then IE worked and Firefox didn't. It appears a solution, perhaps not the only solution, is to implement distinct styling that satisfies various browsers in the case of a modalpopup being combined with a dropdown. In that the modal/dropdown combo causes a browser variation, I'm thinking an IE CSS hack (specific to IE and not other browsers) might be needed...

Here's your code with the fix for IE but breaks Firefox (shows the offsets you've described). Followed by a pic of the IE display with the 4px fix. Hope this helps:

<%@. Page Language="C#" MasterPageFile="~/DefaultMaster.master" AutoEventWireup="true" CodeFile="Copy of DropDown.aspx.cs" Inherits="DropDown_DropDown" Title="DropDown Sample" StylesheetTheme="DropDownTheme" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:ScriptManager ID="scriptManager" runat="server" /> <div> <asp:Button ID="Button1" runat="server" Text="Button" /> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel2" TargetControlID="Button1"></ajaxToolkit:ModalPopupExtender> <asp:Panel ID="Panel2" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div style="position: relative; left: -4px; top: -4px;"> <asp:Label ID="Label1" runat="server" Text="Label"> </asp:Label></div> <ajaxToolkit:DropDownExtender ID="DropDownExtender1" runat="server" DropDownControlID="Panel10" TargetControlID="Label1"> </ajaxToolkit:DropDownExtender> </ContentTemplate> </asp:UpdatePanel> </asp:Panel> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:Panel ID="Panel10" runat="server" > 1<br /> 2<br /> 3 </asp:Panel> </ContentTemplate> </asp:UpdatePanel></div></asp:Content>

Silver, now I se the effects of your fix. I'm sorry that I didn't notice it before, but I was to concentrated on the graphics surrounding the label (the blue border and the arrow). As you are saying, your fix aligns the dropdownlist, however the graphics is no longer visisble.

I'm running Firefox 1.5.0.8 and Firefox is missing the graphics with or without the fix.

IE with fix
IE with fix


IE witout fix


Firefox with fix


Firefox without


IE as it should be

Brian, unfortunately your fix doesn't work for me.

Regards,
Jonas


Download latest source at codeplex, build, place AjaxControlToolkit.dll in samplewebsite bin and apply a modal extender to the dropdown sample. Looks okay on IE6 and FF1.5.08

aspx

<div class="demoarea"> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="LinkButton1" PopupControlID="DropPanelx" BackgroundCssClass="modalBackground" /> <asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to see the dropdown"></asp:LinkButton> <div class="demoheading"> DropDown Demonstration </div> <asp:Panel ID="DropPanelx" runat="server"> <asp:Label ID="TextLabel" runat="server" Text="Hover Over Me" Font-Names="Tahoma" Font-Size="11px" Style="display: block; width: 300px; padding:2px; padding-right: 50px;" /> <asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style="display:none;visibility:hidden;"> <asp:LinkButton runat="server" ID="Option1" Text="Option 1" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option2" Text="Option 2" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option3" Text="Option 3 (Click Me!)" CssClass="ContextMenuItem" OnClick="OnSelect" /> </asp:Panel></asp:Panel> <ajaxToolkit:DropDownExtender runat="server" ID="DDE" TargetControlID="TextLabel" DropDownControlID="DropPanel" /> <br/>

Well, i have the same offset-Problem. i have a panel outside my DDE and the dedicated controls (Hyperlink and MenuePanel). And this Panel has a Stylesheet with position-attributes (position: absolute). When i disable these position-attributes, the DDE appears at the correct position.

Maybe it can be a answer to your problems with the DDE.

cu, Xela


Seethis issue. They marked it closed, but it's not solved. The OP solution works.

Description
When i put a dropdown in a gridview , I get an offset X of 4 pixels and an offset Y of 3 pixels

If I remove lines 211 and 215 in common.js. It works.

DropDownExtender list is very disconnected from DropDownExtender label...why?

HI,

I have included a DropDownExtender control on my site's master page (currently with only two options to drop down). The DDE is targeting an asp:Label.

My problem is that when I move my mouse over the Label, the drop down list shows up at the bottom of the page! (For what it matters, in the past I have tried replacing the DDE with a HoverMenu and still the same problem occurs; the options that show up after hovering over the list show up at the bottom of the page).

The only styles I have in the table column that the DDE is located in is:

width:30%;text-align:left;

Does anyone have any idea as to why this is occurring...and what the fix could be? I appreciate any help, thank you. Frank

I have included the body of the site here:

******************

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"/>

<imgsrc="pics/BGfade.jpg"id="bg"alt=""/>

<divid="content">

<!--Main Table for the body-->

<tableid="maintable">

<!--Title/Navigation Links Row-->

<trid="title">

<tdcolspan="2">

<imgsrc="pics/anomaliestitle.jpg"alt=""/>

<p>

<aid="homelink"runat="server"href="http://www.maybusher.com/Default.aspx">Blog Frankly</a>

<aid="anomalylink"runat="server"href="Default.aspx">Anomalies Home</a>

<aid="emaillink"runat="server"href="Email.aspx">Contact Me</a>

<aid="adminlink"runat="server"href="Login.aspx">Admin</a>

</p>

<p></p>

</td>

</tr>

<!--Main Content-->

<trid="midbody">

<!--Left Content Selection Column-->

<tdid="leftcolumn">

<cc1:DropDownExtenderID="ddeCategories"runat="server"

TargetControlID="lblDropUFO"

DropDownControlID="panelDropUFO">

</cc1:DropDownExtender>

<asp:PanelID="panelDropUFO"runat="server"

Style="display:none; visibility:hidden;">

<asp:LinkButtonID="lbUFOImages"runat="server"

Text="UFO Images"

Width="114px"

OnClick="lbUFOImages_Click"/><br/>

<asp:LinkButtonID="lbUFOVids"runat="server"

Text="UFO Videos"

Width="115px"/>

</asp:Panel>

<asp:LabelID="lblDropUFO"runat="server"

Text="UFO's"Width="119px"/>

</td>

<!--Middle Content Column-->

<tdid="midcolumn">

<asp:contentplaceholderid="body"runat="server">

</asp:contentplaceholder>

<p></p>

</td>

</tr>

<!--Footer Row-->

<trid="footer">

<tdcolspan="2">

<p>©2007 Frank Maybusher. All Rights Reserved.</p>

</td>

</tr>

</table>

</div>

</form>

</body>

Hi Maybush1,

I was failed to reproduce your issue with the sample code so I suspect that your Ajax Control Toolkit lower than V10618. If true, please please upgrade and have a test. Also, I should suggest you add CSS to your Panel (panelDropUFO).

Best regards,

Jonathan


Hi Jonathan,

Thanks for your reply.

I have tried what you suggested: upgraded the Toolkit to version 10920 and also I have tried positioning the Panel using CSS to no avail. The panel just does not want to respond to anything. It it still very disconnected and about 300 pixels down from the actual TargetControl Label. I've been trying to work on this for several weeks now (no kidding)! I'm at a complete loss.

Frank


Hi Maybush1,

I have tested with your code on my machine and it works pretty well. So really sorry that we cannot reproduce your issue and give your further more advices. Here is the test sample.

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <img src="pic/upg_Business.jpg" id="bg" alt="" /> <div id="content"><!--Main Table for the body--> <table id="maintable"><!--Title/Navigation Links Row--> <tr id="title"> <td colspan="2"> <img src="pic/upg_HomeBasic.jpg" alt="" /> <p> <a id="homelink" runat="server" href="http://www.maybusher.com/Default.aspx">Blog Frankly</a>       <a id="anomalylink" runat="server" href="Default.aspx">Anomalies Home</a>       <a id="emaillink" runat="server" href="Email.aspx">Contact Me</a>       <a id="adminlink" runat="server" href="Login.aspx">Admin</a> </p> <p> </p> </td> </tr><!--Main Content--> <tr id="midbody"><!--Left Content Selection Column--> <td id="leftcolumn"> <ajaxToolkit:DropDownExtender ID="ddeCategories" runat="server" TargetControlID="lblDropUFO" DropDownControlID="panelDropUFO"> </ajaxToolkit:DropDownExtender> <asp:Panel ID="panelDropUFO" runat="server" Style="display: none; visibility: hidden;"> <asp:LinkButton ID="lbUFOImages" runat="server" Text="UFO Images" Width="114px"/><br /> <asp:LinkButton ID="lbUFOVids" runat="server" Text="UFO Videos" Width="115px" /> </asp:Panel> <asp:Label ID="lblDropUFO" runat="server" Text="UFO's" Width="119px" /> </td> </tr><!--Footer Row--> <tr id="footer"> <td colspan="2"> <p> ?2007 Frank Maybusher. All Rights Reserved.</p> </td> </tr> </table> </div> </form>

My Ajax Control Toolkit's version is V10618. Would you please test it on another machine? If your problem is still there, please share more information.

I hope this help.

Best regards,

Jonathan

DropDownExtender LinkButton doesnt work

I am currently using a DropDownExtender to provide a SharePoint like experience with a drop down on a link button. This seems to work fine in IE7, but when I get to IE6, clicking on the LinkButton will activate the drop down (rather than firing the LinkButton's Click event). I've posted the pertinent code below. Thanks for any help!

Mike

<asp:LinkButton Style="padding-right: 25px; display: block; padding-left: 2px; padding-bottom: 2px;
padding-top: 2px;" ID="NameLink" runat="server" Text='<%# Bind("Name") %>'
Enabled='<%# Bind("HasChildren") %>' OnClick="NameLink_Click" CommandArgument='<%# Eval("ComponentIndex") %>'></asp:LinkButton>

<asp:Panel Style="display: none; visibility: hidden" ID="NameOptions"
runat="server">
<table>
<tbody>
<tr>
<td style="width: 6px">
<asp:Image ID="Image2" runat="server" ImageUrl="~/ReportTool/images/AddToPage.bmp"></asp:Image></td>
<td>
<asp:LinkButton ID="PropertiesLink" OnClick="EditProperties_Click" runat="server"
CommandArgument='<%# Eval("ComponentIndex") %>' Enabled='<%# Eval("Editable") %>'>Properties</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 6px">
<asp:Image ID="Image3" runat="server" ImageUrl="~/ReportTool/images/delete_16x.ico">
</asp:Image></td>
<td>
<asp:LinkButton ID="RemoveLink" OnClick="RemoveLink_Click" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
Enabled='<%# Eval("Removeable") %>'>Remove</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 6px">
</td>
<td>
<asp:LinkButton ID="MoveItemButton" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
Enabled='<%# Eval("Moveable") %>' OnClick="MoveItemButton_Click">Move Item</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 6px">
</td>
<td>
<asp:LinkButton ID="SequenceItemButton" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
Enabled='<%# Eval("Sequenceable") %>' OnClick="SeqItemButton_Click">Sequence Item</asp:LinkButton></td>
</tr>
<tr>
<td style="width: 6px">
</td>
<td>
<asp:LinkButton ID="StyleButton" runat="server" CommandArgument='<%# Eval("ComponentIndex") %>'
Enabled='<%# Eval("Styleable") %>' OnClick="StyleButton_Click">Style</asp:LinkButton></td>
</tr>
</tbody>
</table>
</asp:Panel>
<cc1:DropDownExtender ID="DropDownExtender1" runat="server" TargetControlID="NameLink"
HighlightBackColor="wheat" DropDownControlID="NameOptions">
</cc1:DropDownExtender>

Hi,

I tried it on IE 6 with following code, the click event is successfully fired.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void OnSelect(object sender, EventArgs e) { } protected void TextLabel_Click(object sender, EventArgs e) { Response.Write("fired"); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:LinkButton ID="TextLabel" Text="Select your favorite exotic ice-cream flavor" runat="server" Style="display: block; width: 300px; padding:2px; padding-right: 50px; font-family: Tahoma; font-size: 11px;" OnClick="TextLabel_Click">LinkButton</asp:LinkButton> <asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style="display :none; visibility: hidden;"> <asp:LinkButton runat="server" ID="Option1" Text="Mocha Blast" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option2" Text="Java Cyclone" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option3" Text="Dry Fruit" CssClass="ContextMenuItem" OnClick="OnSelect" /> </asp:Panel> <ajaxToolkit:DropDownExtender runat="server" ID="DDE" DropArrowImageUrl="../images/arrowvf2.gif" TargetControlID="TextLabel" DropDownControlID="DropPanel" /> <br /> </div> </form></body></html>

Can you update to the most recent version of AjaxControlToolkit and try again.

If it still doesn't work, can you post a simple page here? It seems you are using it in a GridView control, can you change the sample to use NorthingWind database?


Hi Raymond, Thank you for your reply!

I first loaded the update ajaxcontroltoolkit. That changed things so that link was getting clicking but then I couldn't activate the drop down. I then noticed that you had "width: 300px" and I wasn't specifying a width. After I added that, all is ok.

Now if only I can get it to work onFirefox ...

Mike


But it works on Firefox too according to my test.

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?

DropDownExtender in a GridView issues (v1.0 beta)

I am trying to add a DropDownExtender within a GridView control using the code below but it fails i.e. The DropDownExtender is never displayed (no javascript errors). Then if I use the paging in the gridview to navigate to another page and hover over a row it causes a javascript error 'Line 196 Error: Object doesn't support this method or property'.

I've tried this with other controls (e.g. TextboxWatermark) in a GridView and they work ok but are a bit glitchy. Is this a known issue?

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="Number,Sequence" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style='display:none;visibility:hidden;'>
<asp:LinkButton runat="server" ID="Option1" Text="Option 1" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option2" Text="Option 2" CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton runat="server" ID="Option3" Text="Option 3 (Click Me!)" CssClass="ContextMenuItem" OnClick="OnSelect" />
</asp:Panel>
<asp:Label ID="TheLabel" runat="server" Text="Howydoing" />
<ajaxToolkit:DropDownExtender ID="DDE" runat="server" DropDownControlID="DropPanel" TargetControlID="TheLabel"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Number" HeaderText="Number" ReadOnly="True" SortExpression="Number" />
<asp:BoundField DataField="Sequence" HeaderText="Sequence" ReadOnly="True" SortExpression="Sequence" />
<asp:BoundField DataField="Reference" HeaderText="Reference" SortExpression="Reference" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
</Columns>
</asp:GridView>

Javascript where error occurs is: (this is part of the AjaxControlToolkit runtime scripts):

// NOTE: [rb] replaced with CommonToolkitScripts version
// var offsetParentLocation = Sys.UI.DomElement.getLocation(offsetParent);
// var parentBounds = Sys.UI.DomElement.getBounds(parent);
var offsetParentLocation = CommonToolkitScripts.getLocation(offsetParent);
var parentBounds = CommonToolkitScripts.getBounds(parent);

The problem here looks to be an issue with the current beta of ASP.NET AJAX, and I am following up with Shawn Burke and the ASP.NET AJAX team at Microsoft. The issue at hand is that ScriptManager currently emits all of its script for Extenders and ScriptReferences in it's own PreRender event which will happen before the PreRender event of the GridView. In the initial page request (Page.IsPostBack == false), a GridView bound using DataSourceID will delay binding until the last possible moment, which happens to be PreRender.

Until the ASP.NET AJAX team can address this issue, the quickest way to solve the bug is to temporarily add the following code to your Page or UserControl:

1protected void Page_Load(object sender, EventArgs e)2{3if (!Page.IsPostBack)4 {5 Grid.DataBind();6 }7}8 

Where Grid is the name of your DataGrid. This will cause the binding to the DataSourceID to happen in Load as opposed to PreRender.

Try the above and see if it solves your problem. I have another application I am working on that is exhibiting the same issue and this fixed it.


Thanks for that - that solved part of the problem to do with why it wasn't working on the first page display, however I was still getting the Javascript error. After a bit of debugging I found the following error in AjaxControlToolkit\Common\Common.js Line 196, which read:

var mediumThickness = this.parseBorderThickness("medium");

parseBorderThickness doesn't exist. however _borderThicknesses does and has values for thin, medium and thick. So changing the line to read:

var mediumThickness = this._borderThicknesses.medium;

solved the issue, however the DropDown is not quite aligned properly with the text so it looks like there is some additional work required in this area - maybe this will be fixed in the next release.


Thanks for pointing that out, that was a bad reference. The correct function name isparseBorderWidth not parseBorderThickness. I have made the change and checked it in and it should be corrected in the next toolkit release.

Can you provide me with some further details as to the alignment issue, or a sample I might be able to look at (source code/designwise) that I can try to use to figure out what might be causing a problem with the offset?


Source code is below. There are 2 issues:

1) The alignment of the DropDown box when hovering over 'TheLabel' is wrong in IE 6. This is correct when using Firefox 2.0. I am able to resolve this in IE by modifying the Common.js file like so:

if(defaultTdLeftBorderFound) offsetX -= mediumThickness + 4; //(Previously was -1)
if(defaultTdTopBorderFound) offsetY -= mediumThickness + 3; //(Previously was -1)

2) The glitchy behaviour I mentioned earlier seems to be a problem with other controls as well (at least TextBoxWatermark) which occurs when you navigate to the last page in a paged grid. I get a Javascript error in MicrosoftAjax.js: Line 451: Error: '_behaviors' is null or not an object

Default.aspx:
<%@. Page Language="C#" AutoEventWireup="true" %>
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<script runat="server">
protected void Page_Load(Object sender, EventArgs args)
{
if (!Page.IsPostBack)
{
GridView1.DataBind();
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style>
.ContextMenuPanel
{
background-color:white;
border: 1px solid #868686;
z-index: 1000;
cursor: default;
padding: 1px 1px 0px 1px;
font-size: 11px;
}
a.ContextMenuItem
{
display: block;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="Number,Sequence" DataSourceID="XmlDataSource2">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style='display:none;visibility:hidden;'>
<asp:LinkButton runat="server" ID="Option1" Text="Option 1" CssClass="ContextMenuItem" />
<asp:LinkButton runat="server" ID="Option2" Text="Option 2" CssClass="ContextMenuItem" />
<asp:LinkButton runat="server" ID="Option3" Text="Option 3 (Click Me!)" CssClass="ContextMenuItem" />
</asp:Panel>
<asp:Label ID="TheLabel" runat="server" Text="Howydoing" />
<ajaxToolkit:DropDownExtender ID="DDE" runat="server" DropDownControlID="DropPanel" TargetControlID="TheLabel"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Number" HeaderText="Number" ReadOnly="True" SortExpression="Number" />
<asp:BoundField DataField="Sequence" HeaderText="Sequence" ReadOnly="True" SortExpression="Sequence" />
<asp:BoundField DataField="Reference" HeaderText="Reference" SortExpression="Reference" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
</Columns>
</asp:GridView>
<asp:XmlDataSource ID="XmlDataSource2" runat="server">
<Data>
<TheData>
<row Number="asdfasdf" Sequence="001" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="002" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="003" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="004" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="005" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="006" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="007" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="008" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="009" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="010" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="011" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="012" Title="eflwef fwe " Reference="fwefwewefwef"/>
<row Number="asdfasdf" Sequence="013" Title="eflwef fwe " Reference="fwefwewefwef"/>
</TheData>
</Data>
</asp:XmlDataSource>
</div>
</form>
</body>
</html>

Notes: Web.config is taken direct from C:\Program Files\MicrosoftASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\web_CTP.config and needsreferences to Microsoft.Web.Preview.dll and AjaxControlToolkit.dll


I've found that using a repeater table works just fine, but I continue to have problems with the GridView.

Suman Chakrabarti [MSFT]


I notive the alignment problem when placed inside a table with a border > 0px . If I set the boder to zero it lines up.
is this fixed in the current downloadable rc1 version?

Hi,

did you solve this problem? I have got the same problem at the moment. Is there a solution available?

--edit--

I just saw, my code is a little bit different

 <asp:HyperLink ID="hl1" runat="Server" NavigateUrl='<%# Eval("Id")%>' OnDataBinding="hl1_DataBinding"><asp:Label ID="TheLabel" runat="server" Text="Howydoing" /></asp:HyperLink>

DropDownExtender for a Control inside another DropDownExtender?

I currently have one DropDownExtender that shows a Panel with another Control, this case a Label, and another DropDownExtender uses that Label as its target. Like a menu inside of a menu. But when I hover over the Label inside of the first DropDownExtender's Panel, the DropDownExtender that appears is very far off from where it should be. Is it possible to nest DropDownExtender's like this at the moment? Or is this just a bug for now?

Hi,

Can you fire an issuehere?

Thank you.

DropDownExtender causes double postback

Hi,

Is it a known issue that the DropDownExtender causes a double postback? When this control is removed the problem doesn't happen. Worse still it gets into if(isPostBack)... Is there a work around for this?

Best regards,

Sean

Try set autopostback = false on the DropDown control.


The DropDownExtender does not have an autopostback field. I am talking about the DropDownExtender that comes with the Atlas toolkit. Also, I forgot to mention that this problem only happens in FireFox. The double postback does not happen in IE.


Hi Seeeaan,

DropDownExtender itself won't cause any postbacks. Just like the ModalPopupExtender, when drop the the element which is associated with DropDownExtender will show a panel. When click on the control inside the panel, it may cause a postback. But all this based on the clicked control instead of DropDownExtender. So would you please have a check on the controls inside the Panel. Here is a sample.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void OnSelect(object sender, EventArgs e) { lblSelection.Text = "You selected <b>" + ((LinkButton)sender).Text + "</b>."; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Label ID="TextLabel" runat="server" Text="Select your favorite exotic ice-cream flavor" Style="display: block; width: 300px; padding:2px; padding-right: 50px; font-family: Tahoma; font-size: 11px;" /> <asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Style="display :none; visibility: hidden;"> <asp:LinkButton runat="server" ID="Option1" Text="Mocha Blast" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option2" Text="Java Cyclone" CssClass="ContextMenuItem" OnClick="OnSelect" /> <asp:LinkButton runat="server" ID="Option3" Text="Dry Fruit" CssClass="ContextMenuItem" OnClick="OnSelect" /> </asp:Panel> <ajaxToolkit:DropDownExtender runat="server" ID="DDE" TargetControlID="TextLabel" DropDownControlID="DropPanel" /> <asp:UpdatePanel id="Update" runat="server"> <ContentTemplate> <asp:Label id="lblSelection" runat="server" Style="padding: 5px;" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Option1" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="Option2" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="Option3" EventName="Click" /> </Triggers> </asp:UpdatePanel> </form></body></html>

To find out whether a double postback occurred, we suggest that you should use a debugging tool such as Web Developer Helper, Fiddler etc.

I hope this help.

Best regards,

Jonathan


Hi Jonathan,

Ok, I shouldn't be calling it a postback. As I mentioned this problems seems to occur on Firefox but not in IE. What I meant to say is that Page_Load is triggered twice. I've set a breakpoint at if(!ispostback) when the page first loads and the breakpoint is triggered twice.

If you try this using the DropDdownExtender sample that comes with the toolkit, you will see what I mean. Again, this problem occurs with Firefox only.

Best regards,

Sean


Hi Seeeaan,

1protected int i = 0;2protected void OnSelect(object sender, EventArgs e)3 {4 lblSelection.Text ="You selected <b>" + ((LinkButton) sender).Text +"</b>.";5 }6protected void Page_Load(object sender, EventArgs e)7 {8 i++;9if (!IsPostBack) {10 i++;11 }12 }

I have added breakpoints at line 8 and 9 and then had a test(The test sample is the sample contains inside Ajax Control Toolkit). My test shows Page_Load only was fired one time but not twice.

My system environments: Windows 2003 + Visual Studio 2005 + Asp.NET 2.0 Ajax Extensions V1.0 + Ajax Control Toolkit V10618.

Test browsers: IE7 + Firefox2.0.

In your situation, If there is an asynchronous postback (some Ajax Controls,for example: AutoComplete), it will cause Page_Load is called twice.

So in brief, my suggestion is check your system environments and your code.

I hope this help.

Best regards,

Jonathan


Hmm... could be something different with my system environment. However, this problem has disappeared in the latest Control Toolkit released a few days ago.

Thanks for spending the time to have a look at this problem.

Cheers,

Sean

DropDownExtender cannot work correctly in IE6 and Firefox 2.0. Theme cannot change in Fire

Hi there,
A week later, I begin develop a new shop cart application with Ajax enabled.
My problem is:
1. My Page option feature (to change site's theme) is put in a panel with a DropDownExtender.
It cannot show/hide correctly:
- In Internet Explorer 6.0, italway show a "area" at top or bottom in the page.
Click on darkblue and pink icon still can change page skin.
- In Firefox browser, my application hide/show "area" correctly. But, when click on any icon
(an asp:ImageButton), after a postback,page's theme doesn't change.
- In Opera, and IE 7, everything is fine.

Please help me.
This is my demo site url:
http://ajaxshop-1.at.vwdhosting.net/
"Page option" in my language is: "Tùy ch?n trang" - under the search bar.

My source code:

1/*2* This is my user control aspx code3*/4"C#" AutoEventWireup="true" CodeFile="SelectTheme.ascx.cs" Inherits="UserControls_SelectTheme" %>5"AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>6

"right">7

class="PageOptionTextStyle">8 "HyperLinkPageOption" runat="server" Text="Tùy ch?n trang "9 Width="100px">10 "DropDownExtender1" runat="server" DropDownControlID="PanelPageOption"11 TargetControlID="HyperLinkPageOption" HighlightBorderColor="transparent" >1213 "PanelPageOption" runat="server" Width="100px">14

"vertical-align:middle;text-align:center; background-color:LightYellow; height:20px; border-right: gray 1px ridge; border-top: gray 1px ridge; border-left: gray 1px ridge; border-bottom: gray 1px ridge;" align="left">15

16"middle" height="20px">17"middle">18class="innerlink"> Màu s?c: 19"ImageButtonDarkBlueSeclect" runat="server" SkinID="DarkblueSkinSelectButton" OnClick="ImageButtonDarkBlueSeclect_Click">20 21"ImageButtonDarkRedSelect" runat="server" SkinID="DarkredSkinSelectButton" OnClick="ImageButtonDarkRedSelect_Click">222324

2526

2728

29

303132/*33* This is code behind34*/35public partialclass UserControls_SelectTheme : System.Web.UI.UserControl36{37protected void Page_Load(object sender, EventArgs e)38 {3940 }41protected void ImageButtonDarkBlueSeclect_Click(object sender, ImageClickEventArgs e)42 {43 MySetTheme("Darkblue");44 }45protected void ImageButtonDarkRedSelect_Click(object sender, ImageClickEventArgs e)46 {47 MySetTheme("Darkred");48 }4950protected void MySetTheme(string themename)51 {52//Apply new theme53 Profile.CurrentTheme = themename;5455//Transfer to previous page56 Server.Transfer(Page.AppRelativeVirtualPath.ToString());57 }58}5960

Sorry, y writing "A week later, I begin developing a new shop cart application with Ajax enabled.
" i mean "A week before, I began develop a new shop cart application with Ajax enabled"

And, if you don't want to check my error in my web page, you can view this image

Error in IE6

DropDownExtender breaks the XP theme of TextBox

Guys I have problem with DropDownExtender which extends TextBox control.

Step 1. Before mouse is over the TextBox:

Step 2. Mouse is over the TextBox:

Step 3: Mouse is out of TextBox:

As you can see TextBox has become old-style designed. Any advice is appreciated

Hi,

I've tested it,didn't run into the same probem.

If you haven't resolved the problem yet,please feel free to provide us with a repro of it.

Thanks


We are marking this issue as "Answered". If you have any new findings or concerns, please feel free to unmark the issue.