Saturday, March 24, 2012

Deploy of Atlas Application

Hi Everyone,

Just wanted to say congrats to the Atlas team on the December release, I'm just delving in now, but you couldn't have made it easier for me/us. You have certainly stripped the complexity out of the previous versoin.(I wasnt that keen on learning xml and finetuning my javascript)

The question that I have is:

I have an Atlas app that works fine in my development environment, but when I deploy it to test it on my network through IIS I get javascript errors "Object Required". I probably a case of not beeing able to see the forest through the trees here but is it something small that I have overlooked?

I look at the way that the page gets renderd and I can see that the Script manager is pointing to the debug version of atlas...do I need to point it to the release version?

any reply would be appreciated

Debugging script errors can be a little tricky. Does the script error come with a line number? If you find the location of the error in the script, it might help understanding what's going on. Or, if you can attach a script debugger to IE (e.g. Visual Studio works well), the debugger should point you straight to the error when it happens.

thanks,

David


Yeah I looked at the source and found that there is no correlation between the JavaScript Error line number and the ones in the Source of the page. (Line 1609). I will try turning on the visual studio debugger and see where that gets me. It seems to me that the problem lies with deploying the application using the visual studio. In my dev environment it works great. It just wont work on my localhost/appname/default.aspx (Keep in mind its the December release So there is no JavaScript or XML that I have used for my example, which is basically a textbox that filters a gridview in an atlas update panel. Nothing to it!!) . Thanks for the advice non the less I will check it out in the vs script debugger.
Cheers


I suggest you setup development on the deploying server

If everything works fine on your terminal then its a setup issue on thetarget server, check the target server is running tha latest .net 2environment and the site is properly deployed

either that or somethin gyou have over looked in your code

Here is the markup

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

<div>

<asp:LabelID="Label1"runat="server"Text="Type Here:"></asp:Label>

<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>

<atlas:UpdatePanelID="grdUpdate"runat="server">

<ContentTemplate>

<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="False"DataSourceID="SqlDataSource1"CellPadding="4"ForeColor="#333333"GridLines="None">

<Columns>

<asp:BoundFieldDataField="LastName"HeaderText="LastName"SortExpression="LastName"/>

<asp:BoundFieldDataField="FirstName"HeaderText="FirstName"SortExpression="FirstName"/>

<asp:BoundFieldDataField="Title"HeaderText="Title"SortExpression="Title"/>

<asp:BoundFieldDataField="BirthDate"HeaderText="BirthDate"SortExpression="BirthDate"/>

<asp:BoundFieldDataField="TitleOfCourtesy"HeaderText="TitleOfCourtesy"SortExpression="TitleOfCourtesy"/>

<asp:BoundFieldDataField="HomePhone"HeaderText="HomePhone"SortExpression="HomePhone"/>

</Columns>

<FooterStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>

<RowStyleBackColor="#EFF3FB"/>

<EditRowStyleBackColor="#2461BF"/>

<SelectedRowStyleBackColor="#D1DDF1"Font-Bold="True"ForeColor="#333333"/>

<PagerStyleBackColor="#2461BF"ForeColor="White"HorizontalAlign="Center"/>

<HeaderStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>

<AlternatingRowStyleBackColor="White"/>

</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

SelectCommand="SELECT LastName, FirstName, Title, BirthDate, TitleOfCourtesy, HomePhone FROM Employees WHERE (LEFT (LastName, LEN(@.LastName)) LIKE '%' + @.LastName + '%') OR (@.LastName IS NULL)">

<SelectParameters>

<asp:ControlParameterControlID="TextBox1"DefaultValue=""Name="LastName"PropertyName="Text"Type="String"ConvertEmptyStringToNull="true"/>

</SelectParameters>

</asp:SqlDataSource>

</div>

Here is the code behind

ProtectedSub TextBox1_TextChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles TextBox1.TextChanged

IfMe.TextBox1.Text =""Then

Me.SqlDataSource1.SelectParameters("LastName").DefaultValue =""

Else

Me.SqlDataSource1.SelectParameters("LastName").DefaultValue =Me.TextBox1.Text

EndIf

Me.GridView1.DataBind()

EndSub

To Run this you will need to make a connection in your webconfig to the Northwind db.. Once its up and running in the dev environment. Type a letter in the textbox and press enter, list of employees with that name should apear.

This code works fine in my dev environment...but when I deploy the app in IIS on my dev box I get the javascript error. Can someone try it out and see if they get the same result..

No comments:

Post a Comment