Saturday, March 24, 2012

Problem adding Atlas to an existing site

I have created a test atlas site and successfully used the update panel with some dropdown lists. Now I want to incorporate Atlas into an existing web site. I created a test page in the existing web site and recreated my test page in the existing site. The Atlas components to not seem to work... instead of an ajax update it is doing a full postback.

Here are the things I've checked:

- Atlas dll is included in bin
- Web.config file is updated and matches the test site config exactly
- Test web page is exactly the same as on the test site
- The .asbx extension is registered correctly
- The web site is configured for .Net 2.0

I'm not even sure how to figure out what else is going on here. Any other suggestions or things I can look at here? Thanks!

hello.

have you created a simple page on that site? if so, post it here so that we can see if there's anything wrong with it or if it's a configuration problem...


I have done a simple page on the test site (which works) and the exact same page in the existing site (which doesn't work) so I'm not sure the code provides any value. But here is another clue. When I add the trigger to the update panel through the designer, switch to code view, and then back to designer I get an "error creating control"

It says: Triggers could not be initialized. Triggers could not be added to the collection. Details: Object does not match target type.

Here is the web page code:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="IssueTest.aspx.cs" Inherits="ProjectTrack_IssueTest" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title> </head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> </atlas:ScriptManager> <asp:DropDownList ID="ClientsDDL" runat="server" DataSourceID="RDI_DB" DataTextField="CO_NAME" DataValueField="Client_ID" OnSelectedIndexChanged="ClientsDDL_SelectedIndexChanged" AutoPostBack=true> </asp:DropDownList><atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional"> <Triggers> <atlas:ControlEventTrigger ControlID="ClientsDDL" EventName="SelectedIndexChanged" /> </Triggers> <ContentTemplate> <asp:DropDownList ID="ProjectsDDL" runat="server" DataTextField="PROJ_NAME" DataValueField="PROJECT_NO" AppendDataBoundItems=true AutoPostBack="True" OnSelectedIndexChanged="ProjectsDDL_SelectedIndexChanged"><asp:ListItem>Select a client</asp:ListItem> </asp:DropDownList> </ContentTemplate> </atlas:UpdatePanel> <asp:DropDownList ID="PhaseDDL" runat="server" DataTextField="DESCRIPTION" DataValueField="PHASE" AppendDataBoundItems=true AutoPostBack="True"><asp:ListItem>Select a project</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="TaskDDL" runat="server" DataTextField="TASK" DataValueField="TASK" AppendDataBoundItems=true><asp:ListItem>Select a phase</asp:ListItem> </asp:DropDownList> <asp:SqlDataSource ID="RDI_DB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [Client_ID], [CO_NAME] FROM [CLIENTS]"></asp:SqlDataSource> <asp:SqlDataSource ID="ProjectListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [PROJECT_NO], [PROJ_NAME] FROM [PROJ_NO] WHERE ([CLIENT_ID] = @.CLIENT_ID)"> <SelectParameters> <asp:ControlParameter ControlID="ClientsDDL" Name="CLIENT_ID" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="PhaseListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [PHASE], [DESCRIPTION] FROM [PHASE] WHERE (([CLIENT_ID] = @.CLIENT_ID) AND ([PROJECT_NO] = @.PROJECT_NO)) ORDER BY [DESCRIPTION]"> <SelectParameters> <asp:ControlParameter ControlID="ClientsDDL" Name="CLIENT_ID" PropertyName="SelectedValue" Type="Int32" /> <asp:ControlParameter ControlID="ProjectsDDL" Name="PROJECT_NO" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="TasksListDB" runat="server" ConnectionString="<%$ ConnectionStrings:RDI_DevelopmentConnectionString%>" SelectCommand="SELECT [TASK], [DESCRIPTION] FROM [TASK] WHERE ([PHASE] = @.PHASE)"> <SelectParameters> <asp:ControlParameter ControlID="PhaseDDL" Name="PHASE" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource>   </form></body></html>

hello.

tell me something: can you run the following code with success:

<atlas:scriptmanager runat="server" id="manager" enablepartialrendering="true" />

<atlas:updatepanel runat="server" id="panel">
<contenttemplate>
<asp:button runat="server" Text="Submit" />
<%=DateTime.Now.ToString() %>
</contenttemplate>
</atlas:updatepanel>


Same results... in my existing web site it causes a postback. In my test web site it does an ajax update (no postback). Does that tell you anything? Thanks.

hello again.

one more question:

open the previous page on the browser, right click on it and look at the source code. find the script element that is used to load the js file (you might have several elements that user the webresource.axd on the page; in this case, you'll have to repeat it to all the items you find). copy the address that is in the src attribute of the script element and add it to the url of the page you have in the browser (you'll probably have to delete a portion of the url before adding the value you've copied from the source file).

can you get the file? ie, can you get the js atlas file? if you can't get the file (you should see the tradidional save dialog), then you have a iis configuration problem...

No comments:

Post a Comment