Showing posts with label causes. Show all posts
Showing posts with label causes. Show all posts

Monday, March 26, 2012

dropshadowextender causes a page to draw in 2 stages

All --

Please help.

Why is it that the dropshadowextender causes a page to draw in 2 stages?

How can it be avoided?

Here are the details.

    I have an ASP.NET page written in C# using VS.NET and Ajax RC1.I have several 4 <DIV> tags on the page.I have a dropshadowextender assigned to each <DIV> tag.When the page loads, it draws in 2 stages.In the 1st stage, the page loads and is drawn as it would look without any Ajax. This view is shown only briefly, about 1 second -- but, it is very visible and noticable.In the 2nd stage, the page is redrawn (or modified) to have the Ajax effects applied. This view remains static until the next refresh.

Is there a workaround?

BTW, the same thing happens with the roundedcornersextender, but the 1st draw of the page lasts much less than a second, so it is hardly noticable.

Please advise.

Thank you.

-- Mark Kamoski

I ran into the similar problem to you when I applyAjax:DropShadowExtender to aasp:Panel. Sometimes the position of the drop shadow will take place changes when pressing F5 to refresh current web page. It is very slow when loading web controls for the first time or pressing?F5?to?refresh current web page.
DropShadow is an extender which applies a "Drop Shadow" to a Panel. It allows you to specify how wide the shadow is as well as how opaque it is, or if you would like rounded corners. For pages that allow the user to move or resize the panel, the DropShadow has a mode that will resize/reposition it to match that of the target panel at run time.

Wednesday, March 21, 2012

DropDownList causes a full page postback instead of only updating the UpdatePanel

I have a code for updating a DropDownList with items whenever another DropDownList triggers a SelectedIndexChanged event.

When I select an item in the DDLSelect dropdown, it causes a full page postback instead of just updating the UpdatePanel. This problem only occurs when I try to implement it in an existing project, and it works fine when if I try it in a new project.

I've updated my Web.config file to make my project compatible with AJAX, so I don't believe that's the problem.

I should add that I'm trying to use this inside an ascx UserControl file, so maybe there are known issues there.

Thanks in advance.

Please post the usercontrol code

OK, problem solved!

It was the Web.config after all. I had this line which caused the problem:

<

xhtmlConformancemode="Legacy"/>

I removed it and everything is fine.

Cheers.

DropDownList and only DropDownList causes Full Page Post Back

I have a radio button list, buttons, a DropDownList within a UpdatePanel.

Buttons, RadioButtonList events work fine doing async request but..the DropDownList events causes a Full Page postback

DroDownList need some additional setting? DropDownList has some ajax limitation ? a bug?

thanks in advance,

Alexander



Can you post your code?


hi,

have you set autopostback = true for dropdown list? try to make it false

thanks,

satish.


I try it and the problem is solved.

but the control doesnt trigger events when "selected item change" and in my case..that's not a wished behavior.

thanks,

Alexander.

PD: I haven't the code now, sorry


I post the .aspx code.

The name of the control tha causes de full page post back is "dropDownListUnits"

thanks.

----------------

<%@.PageLanguage="C#"MasterPageFile="~/SinMenuDerecho.master"AutoEventWireup="true"

CodeFile="PlayerConsole.aspx.cs"Inherits="Player_PlayerConsole"Title="Tablero de Batalla"EnableViewState="true"%>

<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

<%@.RegisterAssembly="GMaps"Namespace="Subgurim.Controles"TagPrefix="cc1" %>

<asp:ContentID="Content1"ContentPlaceHolderID="mainContent"runat="Server">

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

</asp:ScriptManager>

<divstyle="text-align: center">

<divstyle="text-align: center">

<tablestyle="height: 350px; width: 900px">

<tr>

<tdstyle="width: 871px; vertical-align: top;">

<div>

<cc1:GMapID="GMap1"runat="server"enableServerEvents="True"Height="489px"OnClick="GMap1_Click"

Width="672px"/>

</div>

</td>

<tdstyle="vertical-align: top">

<asp:UpdatePanelID="UpdatePanel1"runat="server">

<contenttemplate>

<TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="WIDTH: 100px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="LblGeneral"runat="server"Width="200px"ToolTip="Informaci¢n General de la Batalla"Text="Batalla"CssClass="headerstyle"></asp:Label></TD><TDstyle="WIDTH: 100px"><asp:ImageButtonid="ImageButtonGeneral"onclick="ImageButtonGeneral_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE></TD></TR><TR><TD><asp:Panelid="PanelGeneral"runat="server"Width="100%"Height="50px">

<tablestyle="width: 100%; height: 100%; text-align: left">

<tr>

<tdstyle="font-size: 10pt; font-family: Verdana; font-weight: bold; width: 34px;

height: 18px;">

Id</td>

<tdstyle="height: 18px">

<asp:LabelID="LblGeneralBatalla"runat="server"></asp:Label>

</td>

</tr>

<tr>

<tdstyle="font-weight: bold">

<spanstyle="font-size: 10pt">Tipo</span>

</td>

<td>

<asp:LabelID="LblGeneralTipoBatalla"runat="server"></asp:Label></td>

</tr>

<tr>

<tdstyle="font-weight: bold">

<spanstyle="font-size: 10pt">Turno</span></td>

<td>

<asp:LabelID="LblGeneralTurno"runat="server"></asp:Label></td>

</tr>

<tr>

<tdstyle="font-weight: bold;">

Estado</td>

<td>

<asp:LabelID="LblGeneralEstado"runat="server"></asp:Label></td>

</tr>

</table>

</asp:Panel><cc1:CollapsiblePanelExtenderid="CollapsiblePanelGeneralExtender"runat="server"ExpandControlID="ImageButtonGeneral"CollapseControlID="ImageButtonGeneral"TargetControlID="PanelGeneral">

</cc1:CollapsiblePanelExtender></TD></TR></TBODY></TABLE><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 100px; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 81px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="LblProximaAccion"runat="server"Width="200px"ToolTip="Pr¢xima Acci¢n"Text="Acci¢n"CssClass="headerstyle">

</asp:Label></TD><TDstyle="WIDTH: 100px"><asp:ImageButtonid="ImageButtonAction"onclick="ImageButton1_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE></TD></TR><TR><TDstyle="VERTICAL-ALIGN: top; WIDTH: 100px"><asp:Panelid="PanelAction"runat="server"Width="100%">

<tablestyle="width: 100%; height: 100%">

<tr>

<tdstyle="vertical-align: top; width: auto; text-align: left;">

<asp:RadioButtonListID="RadioButtonListActions"runat="server"CellPadding="0"CellSpacing="0"

AutoPostBack="True"OnSelectedIndexChanged="RadioButtonListActions_SelectedIndexChanged">

<asp:ListItemEnabled="False">Mover</asp:ListItem>

<asp:ListItemEnabled="False">Atacar</asp:ListItem>

<asp:ListItemEnabled="False"Value="PosicionarSatelite">Posicionar Satelite</asp:ListItem>

</asp:RadioButtonList>

<cc1:CollapsiblePanelExtenderID="CollapsiblePanelActionsExtender"runat="server"

TargetControlID="PanelAction"CollapseControlID="ImageButtonAction"ExpandControlID="ImageButtonAction">

</cc1:CollapsiblePanelExtender>

</td>

</tr>

</table>

</asp:Panel></TD></TR></TBODY></TABLE><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 100px; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="WIDTH: 100px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="lblUnidad"runat="server"Width="200px"ToolTip="Mis unidades"Text="Unidades"CssClass="headerstyle"></asp:Label></TD><TDstyle="WIDTH: 100px"><asp:ImageButtonid="ImageButtonUnidad"onclick="ImageButtonUnidad_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE></TD></TR><TR><TD><asp:Panelstyle="TEXT-ALIGN: left"id="PanelUnidad"runat="server"Width="100%"> <asp:DropDownListid="dropDownListUnits"runat="server"OnSelectedIndexChanged="DropDownListUnits_SelectedIndexChanged"AutoPostBack="True"DataValueField="Id"DataTextField="UnitDescription"DataSourceID="PlayerUnitsDataSource">

</asp:DropDownList><asp:ObjectDataSourceid="PlayerUnitsDataSource"runat="server"TypeName="PlayerUnitsDataSource"SelectMethod="GetPlayerUnits">

<SelectParameters>

<asp:QueryStringParameterDefaultValue="null"Name="battleID"QueryStringField="BattleID"

Type="Int32"/>

</SelectParameters>

</asp:ObjectDataSource> <TABLEstyle="WIDTH: 100%"><TBODY><TR><TDstyle="WIDTH: 100px"><STRONG>Info de la Unidad Seleccionada:</STRONG></TD></TR></TBODY></TABLE><BR/><TABLEstyle="WIDTH: 100%"><TBODY><TR><TDstyle="WIDTH: 37px"><STRONG>ID</STRONG></TD><TDstyle="WIDTH: 100px"><asp:Labelid="LblUnidadID"runat="server"></asp:Label></TD></TR><TR><TDstyle="WIDTH: 37px"><STRONG>Tipo</STRONG></TD><TDstyle="WIDTH: 100px"><asp:Labelid="LblUnidadTipo"runat="server"></asp:Label></TD></TR><TR><TDstyle="WIDTH: 37px"><STRONG>Posici¢n</STRONG></TD><TDstyle="WIDTH: 100px"><asp:Labelid="LblUnidadPosicion"runat="server"></asp:Label></TD></TR></TBODY></TABLE></asp:Panel><cc1:CollapsiblePanelExtenderid="CollapsiblePanelUnidadExtender"runat="server"ExpandControlID="ImageButtonUnidad"CollapseControlID="ImageButtonUnidad"TargetControlID="PanelUnidad">

</cc1:CollapsiblePanelExtender></TD></TR></TBODY></TABLE><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 100px; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="WIDTH: 100px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="LabelPlayers"runat="server"Width="200px"ToolTip="Jugadores de la batalla"Text="Jugadores"CssClass="headerstyle"></asp:Label></TD><TDstyle="WIDTH: 100px"><asp:ImageButtonid="ImageButtonPlayers"onclick="ImageButtonPlayers_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE> </TD></TR><TR><TD><asp:Panelstyle="TEXT-ALIGN: left"id="PanelPlayers"runat="server"Width="100%">

<asp:ListBoxID="ListBoxPlayers"runat="server"DataSourceID="BattlePlayersDataSource"

DataTextField="UserName"DataValueField="PlayerID"></asp:ListBox><asp:ObjectDataSource

ID="BattlePlayersDataSource"runat="server"SelectMethod="GetBattlePlayers"TypeName="BattlePlayersDataSource">

<SelectParameters>

<asp:QueryStringParameterDefaultValue="null"Name="battleID"QueryStringField="BattleID"

Type="Int32"/>

</SelectParameters>

</asp:ObjectDataSource>

</asp:Panel><cc1:CollapsiblePanelExtenderid="CollapsiblePanelPlayersExtender"runat="server"ExpandControlID="ImageButtonPlayers"CollapseControlID="ImageButtonPlayers"TargetControlID="PanelPlayers">

</cc1:CollapsiblePanelExtender></TD></TR></TBODY></TABLE><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 100px; HEIGHT: 33px; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="WIDTH: 100px; HEIGHT: 40px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="LblAlliances"runat="server"Width="200px"ToolTip="Alianzas de la batalla"Text="Alianzas"CssClass="headerstyle"></asp:Label></TD><TDstyle="WIDTH: 100px; HEIGHT: 40px"><asp:ImageButtonid="ImageButtonAlliances"onclick="ImageButtonAlliances_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE></TD></TR><TR><TDstyle="HEIGHT: 69px"><asp:Panelstyle="TEXT-ALIGN: left"id="PanelAlliances"runat="server"Width="100%">

<asp:TreeViewID="TreeViewAlliances"runat="server"ImageSet="Contacts"NodeIndent="10"

AutoGenerateDataBindings="False"EnableClientScript="False"PopulateNodesFromClient="False">

<ParentNodeStyleFont-Bold="True"ForeColor="#5555DD"/>

<HoverNodeStyleFont-Underline="False"/>

<SelectedNodeStyleFont-Underline="True"HorizontalPadding="0px"VerticalPadding="0px"/>

<RootNodeStyleFont-Bold="True"/>

<NodeStyleFont-Names="Verdana"Font-Size="8pt"ForeColor="Black"HorizontalPadding="5px"

NodeSpacing="0px"VerticalPadding="0px"/>

<Nodes>

<asp:TreeNodeText="Alianzas"Value="Alianzas">

<asp:TreeNodeText="Alianza1"Value="Alianza1">

<asp:TreeNodeText="Usuario1"Value="Usuario1"></asp:TreeNode>

</asp:TreeNode>

<asp:TreeNodeText="Alianza2"Value="Alianza2">

<asp:TreeNodeText="Usuario2"Value="Usuario2"></asp:TreeNode>

<asp:TreeNodeText="Usuario3"Value="Usuario3"></asp:TreeNode>

</asp:TreeNode>

</asp:TreeNode>

</Nodes>

</asp:TreeView>

</asp:Panel><cc1:CollapsiblePanelExtenderid="CollapsiblePanelAlliancesExtender"runat="server"ExpandControlID="ImageButtonAlliances"CollapseControlID="ImageButtonAlliances"TargetControlID="PanelAlliances">

</cc1:CollapsiblePanelExtender></TD></TR></TBODY></TABLE><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="VERTICAL-ALIGN: bottom; WIDTH: 100px; TEXT-ALIGN: left"><TABLEstyle="WIDTH: 100%; HEIGHT: 100%"><TBODY><TR><TDstyle="WIDTH: 100px"><asp:Labelstyle="FONT-WEIGHT: bold; FONT-SIZE: 10pt"id="lblSatelite"runat="server"Width="200px"ToolTip="Satelites Disponibles del Jugador"Text="Satelites"CssClass="headerstyle"></asp:Label></TD><TDstyle="WIDTH: 100px"><asp:ImageButtonid="ImageButtonSatelite"onclick="ImageButtonSatelite_Click"runat="server"ImageUrl="~/App_Themes/BattleTheme/collapse.jpg"></asp:ImageButton></TD></TR></TBODY></TABLE></TD></TR><TR><TDstyle="HEIGHT: 69px"><asp:Panelstyle="TEXT-ALIGN: left"id="PanelSatelite"runat="server"Width="100%"> <TABLE><TBODY><TR><TDstyle="WIDTH: 122px; HEIGHT: 16px">Satelites Disponibles</TD><TDstyle="WIDTH: 100px; HEIGHT: 16px"><asp:Labelid="LblSatelliteCantidad"runat="server"></asp:Label></TD></TR><TR><TDstyle="WIDTH: 122px"></TD><TDstyle="WIDTH: 100px"></TD></TR></TBODY></TABLE></asp:Panel><cc1:CollapsiblePanelExtenderid="CollapsiblePanelSateliteExtender"runat="server"ExpandControlID="ImageButtonAlliances"CollapseControlID="ImageButtonAlliances"TargetControlID="PanelSatelite">

</cc1:CollapsiblePanelExtender></TD></TR></TBODY></TABLE><asp:Timerid="Timer1"runat="server"Interval="5000"OnTick="Timer1_Tick"></asp:Timer><BR/>

</contenttemplate>

</asp:UpdatePanel>

</td>

</tr>

</table>

</div>

</div>

</asp:Content>


Have you set the property AutoPostBack = true" for DropDownList

Check this forum

http://forums.asp.net/p/1053484/1493464.aspx

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