Showing posts with label firing. Show all posts
Showing posts with label firing. Show all posts

Monday, March 26, 2012

Certain events not firing on server (but they are in dev)

I have a small web app that uses an update panel. Its asyncpostback event fires and updates a session variable. In the process, the pageload event fires and repopulates the elements within my update panel. This works in my dev environment, but doesn't work when I publish the site to my website.

The session variable is updated like it should via asyncpostback, but the pageload event isn't fired. Thus my chart within the updatepanel isn't redrawn. I have ajax installed on the server and the appropriate dll's are in the bin folder.

Any idea why this is happening?

The only thing I can think of is there are differences in your web.config file.


The web.config goes along with the publish (I've even manually copied the file over)


hello.

that is strange because the load event will always fire during a postback. have you tried hosting the app in IIS in your development environment?


Yeah I knew the web.config file went though with the Publish, but I wans't sure if you were using the Publish option in Visual Studio or if you were manually publishing it by copying the dll and aspx files. I had a few ideas as to what might be causing the problem but I keep throwing those ideas out because it is working in your test environment. At this point, I can only take guesses. I dont think AJAX.net is the problem because your session is getting updated aysnc. Since all the code is the same in both environments, that ww know of, I would next try to figure out what is different. Are the dll files different in any way, specifically the ajax dll's. Also try manually deploying the site. I have had some publshing problems with Visual Studio 2005 when publishing to ftp (The host I was using had users experieincing problems with the publish not publishing correctly.) Although the problem I and my host had was more to deal with Visual Studio stopming over some security permssions.. dont ask me how, it just did.


I have manually copied the files to the server as well (it is sitting right next to my desktop on the same domain).


hum...well, not sure on the response your chart is returning from the server. there shoudln't be any problems with it since you're seeing it work on the dev machine. anyway, how about using fiddler to see the response returned from the server ?


fiddler.. hmmm... thats a new one on me. I'll check it out.


it's an http proxy. really good to see the contents sent to and from the browser:

http://www.fiddlertool.com/


It is weird, Have you fixed it?


No, not yet. It's strange that the async call works but the page load isn't firing.

Wednesday, March 21, 2012

CascadingDropDown OnSelectedIndexChanged event not firing

Help!!!

I have 4 drop down list boxes that are extended by the CascadingDropDown control. All of the controls populate in sequence. I am using the OnSelectedIndexChanged event of the 4th DDL to trigger an UpdatePanel. I want to take the selection from the DDL (cmbPart) and add the item to the ListBox (lbParts). When I change the selection in cmbPart, no event fires. When I press the button on the panel (btnRemovefromList) the cmbPart_SelectedIndexChanged event DOES fire before the btnRemovefromList_Click event. I have also tried to use OnSelectedIndexChanged to fire a client side javascript function and that does not fire either. However, the onblur and onclick events DO fire.

According to previous posts on this topic, it was fixed. I have the 1.0.60914.0 version of the AtlasControlToolkit.dll installed along with version 2.0.50727.60725 of Microsoft.Web.Atlas.dll.

Ken J.

Here is the code:

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"EnableEventValidation="false"%>

<%@dotnet.itags.org.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

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

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"/>

<div>

Year<asp:dropdownlistid="cmbFrom"tabIndex="2"runat="server"Width="120px">

</asp:dropdownlist>

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="cmbFrom"

Category="Year"

LoadingText="{Loading Years...}"

PromptText="Select a Year"

ServicePath="EOLDataService.asmx"

ServiceMethod="GetYears"

/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="cmbMake"

ParentControlID="cmbFrom"

Category="Make"

LoadingText="{Loading Makes...}"

PromptText="Select a Make"

ServicePath="EOLDataService.asmx"

ServiceMethod="GetMakes"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="cmbModel"

ParentControlID="cmbMake"

Category="Model"

LoadingText="{Loading Models...}"

PromptText="Select a Model"

ServicePath="EOLDataService.asmx"

ServiceMethod="GetModels"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="cmbPart"

ParentControlID="cmbModel"

Category="Part"

LoadingText="{Loading Parts...}"

PromptText="Select Parts"

ServicePath="EOLDataService.asmx"

ServiceMethod="GetParts"/>

</atlasToolkit:CascadingDropDown>

Make<asp:dropdownlistid="cmbMake"tabIndex="3"runat="server"Width="215px"></asp:dropdownlist>

Model<asp:dropdownlistid="cmbModel"tabIndex="4"runat="server"Width="250px"></asp:dropdownlist>

<INPUTid="txtPartType"type="hidden"runat="server"NAME="txtPartType">

<asp:labelid="lparterr"runat="server"Width="216px"ForeColor="Red"></asp:label>

<atlas:UpdatePanelID="upParts"runat="server"Mode="conditional">

<ContentTemplate>

Part<asp:DropDownListID="cmbPart"runat="server"Width="250px"OnSelectedIndexChanged="cmbPart_SelectedIndexChanged"></asp:DropDownList>

Selected Parts<asp:ListBoxid="lbSelected"tabIndex="10"runat="server"Width="215px"Height="85px"SelectionMode="Multiple"></asp:ListBox>

<asp:Buttonid="btnRemovefromList"style="WIDTH: 54px; font-size:xx-small"tabIndex="9"Text="Remove"

runat="server"onclick="btnRemovefromList_Click"/>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="cmbPart"EventName="SelectedIndexChanged"/>

<atlas:ControlEventTriggerControlID="btnRemoveFromList"EventName="Click"/>

</Triggers>

</atlas:UpdatePanel>

</div>

</form>

<scripttype="text/xml-script">

<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

<references>

</references>

<components>

</components>

</page>

</script>

</body>

</html>

And the code behind:

using System;

using System.Data;

using System.Configuration;

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;

publicpartialclass_Default : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

}

protectedvoid cmbPart_SelectedIndexChanged(object sender,EventArgs e)

{

lparterr.Text ="test";

}

protectedvoid btnRemovefromList_Click(object sender,EventArgs e)

{

lparterr.Text ="Test";

}

}

Maybe have a look atthis post?

Thanks David.

I found that the final DDL had to have AutoPostBack set to true. I also found that using the UpdatePanel to contain only the control I want updated by the ControlEventTrigger. If the DDL controls are contained in the UpdatePanel you will see the CascadingDropDown extender refresh each of the DDLs.

Ken J.