Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Wednesday, March 28, 2012

Ajax beta2 -> RTM > JSON Serialization exception when calling a dataservice

Hi all, I must migrate an application from Ajax beta2 to RTM version and I experienced a serious problem.This application uses xml-script that calls some webservices (more specifically dataservices) to fill in objets. These calls throw json serialization exceptions, whatever the returned type.I then wanted to try with a "fresh" web project, I thus created a new project, and then created a small web service inherited from the dataservice class. I placed a typical example of a sample dataservice from internet into my dataservice. Then I used Fiddler to emulate the dataservice call from the script (ie doing a POST with loadmethod parameters etc…), and this simple code produces a serialization exception.The only information I found is herehttp://www.oreilly.com/catalog/atlas/update/version1.0-update.pdf (chapter 9). This chapter is about the same subject, and the author is experience the same trouble in the same circumstances. Christophe Below is the complete exception:

{"Message":"A circular reference was detected while serializing an object of type \u0027System.Reflection.Module\u0027.","StackTrace":" à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse)\r\n à System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n à System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}

The latest release does not support DataSet, DataTables or the Xml Script. You have to add the Preview to work with these objects.


Have you install framework 2.0?


I am using Microsoft.Web.Preview from the the "ASP.NET Futures May 2007" package (assembly version 1.1.61025.0).

I do not use complex objets like Dataset, Datatables,...

The sample code was picked up fromhttp://aspalliance.com/1302_Unveil_the_Data_Binding_Architecture_inside_Microsoft_ASPNET_Ajax_10__Part_2#Page2, but even a string does not serialize !

Note that the call stack shows an exception within System.Web.Script.Serialization, which is in Ajax Extensions, not in futures ...

Christophe.


No, we have no answer at this time.


Hi chrisrodri,

Has your problem been resolved yet ? Would you share your solution(resolved) or new findings?


Hi all,

I finally solved this issue. I have to add these threw following lines into the web.config (in jsonSerialization/converters section):

<addname="DataSetConverter"type="Microsoft.Web.Preview.Script.Serialization.Converters.DataSetConverter"/>
<addname="DataRowConverter"type="Microsoft.Web.Preview.Script.Serialization.Converters.DataRowConverter"/>
<addname="DataTableConverter"type="Microsoft.Web.Preview.Script.Serialization.Converters.DataTableConverter"/>

I do not understand why these lines are needed because i do not use any DataTable or DataRow, just generics Lists that are not dependant of these ones.... but it works !

Ajax based navigation scheme

Hello,

I am trying to implement Ajax based navigation schema for a complex web application.

Basically, I will have a tree on the left. When item is clicked I want the content area on the page to load some content via Ajax (instead of refreshing the whole page).

I got somewhat far with having an update panel around content area and loading content via custom user controls (e.g. panel.Controls.Add(Page.LoadControl("blah.ascx")) ). However, I am running into some issues with this approach (for complex controls it appears this dynamic loading is breaking javascript etc). Can someone suggest any other mechanism one might use to implement this? Keep in mind, controls cannot be hardcoded on the page and need to come from an external file (e.g. the tree would load from xml file that specifies which controls correspond to which item on the tree).

Thanks

Unless I'm missing something, it sounds like you'd be better off using an IFRAME for your content area and just change it's .src with the navigation system.

Monday, March 26, 2012

Ajax application slow when deploy to server

i have an ajax web application (ajax.net 1.0) written in ASP.NET 2.0

The application runs fast on my local pc. When I deploy the application to server (windows 2003) as a web site, it's very slow.. funny thing is if I create a virtual site under the root (the main web site), it's become fast again.

Anyone encounter similar problem before? I didn't install ajax on the server, I just copy the binaries files. The application runs fine just that it's slow under main web site and not the virtual directory site.

One of the most common causes of an AJAX application running slow is because it is still in debug mode after being published. Make sure that debug is set to false in your web.config as indicated below.

<system.web>
<compilationdebug="false" />
</system.web>


I've set debug=false but that doesn't help.

How to explain why is it slow when deploy under main web site (IIS-> Create new web site) and it's fast when deploy under virtual directory (IIS-> Create virtual directory).


ok. I solved the problem. It appears that there was some javascript refrencing error

<script language="javascript" type="text/javascript" src="http://pics.10026.com/?src=//Js/Menu.js"></script>

as compare to

<script language="javascript" type="text/javascript" src="http://pics.10026.com/?src=/Js/Menu.js"></script>

which cause the problem.

Ajax application not working when deployed to web server

I installed the extender and then the toolkit and was able to create the sample application described here:http://ajax.asp.net/ajaxtoolkit/Walkthrough/UsingSampleExtender.aspx

However, when I deploy the webpage to my company's web server I get the following error when I try to run it:

Server Error in '/ajaxtest' Application.

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (E:\WebSites\ajaxtest\web.config line 41)

Source Error:

Line 39: </httpHandlers>Line 40: <httpModules>Line 41: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 42: </httpModules>Line 43: </system.web>


Source File:E:\WebSites\ajaxtest\web.config Line:41


The file it is referencing (E:\WebSites\ajaxtest\web.config) is there. Does anyone have any idea what's going on? I've Googled the problem and searched on here but nothing seems to work.

Thanks in advance!

Do you have System.Web.Extensions.dll in the bin directory in the server?

Do you mean the bin application of my AJAX enabled web app?

If so, that particular DLL is not in the bin folder, but it's not in the bin folder on my local machine either and it runs fine there. It just doesn't run on the web server.


If you don't have a bin of your application in the bin folder, maybe it's because you don't have a webApp project but a web site project. But, in both cases, you should have more dll's in the bin folder and that dll's should be copied to the bin folder on the server!

That's true. It is a web site project and not a web app project. However, I do have a bin folder for the application on my development machine and the server. When run on my development machine the application works, but when run on the server it doesn't. And neither bin folder has the dll you mentioned.

I'm sorry if I was confusing before.

Regardless, I will see about getting that dll into the proper folder and see what happens from there. Thanks again for your help and advice!


The dll you need should be here:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\System.Web.Extensions.dll

Put it on bin folder on server and it should work, I hope. :P


SWEET! That did the trick!

Thanks a million, Agapito! I really appreciate it.


Gracias! Friend! it worked.

Yes

AJAX Application for Interior Design Company

We are trying to develop a web application for an interior design company.

Functionality of the program

User is able to:-

1) Drag and drop from a list of design elements such as flat rectangular pieces (doors, panel, etc), tubular parts (legs, etc) to a design plan (which is an ASP.NET Panel Control) to form a finished product such as table, shelves, drawer, etc. This design elements are stored as images in MS SQL 2005

2) Change color of the design elements in the design plan

Questions

1) Ajax had a control called the "DragPanel". We had used the "DragPanel" control to allow user to drag a design elements to the design plan. Using "DragPanel" control, we will need to place the design elements in a panel, and then assigned the "DragPanel" control's DragHandleID to the panel. However, we do not want to limit user on the numbers of design elements that they are going to add into design plan to form a finished product. Is there any way we can allow user to add unlimited design elements to the design plan.

2) We are thinking of using the "UpdatePanelAnimation" to change the color of the design elements that are in the design plan. But our design elements are in jpg/gif format, is there any way we can change the design elements to our desired color using any of the AJAX control.

Any help/suggestion will be highly appreciated

My recommendation would be to hire someone who knows javascript to do this; the requirements you're describing are going to require you to delve into it quite a bit.

For the first one, you can more easily create new / additional dragging elements on the client with javascript functions

for the second one, you can either use partially transparent images and use javascript to change the background color on them, or else do image swapping. For best functionality, I'd actually use flash objects and have the javascript send commands to the movieclips to tell them to change colors.

just my 2c.


Have you checked the scope of using these elements being used like or as web parts?

AJAX and WebApplication Project Type

I have a VS2003 Web project I converted to VS2005 sp1 WebApplication project (not WebSite project). I wanted to add AJAX to this web application so I followed the directions outlined in the video on the AJAX site. I added all the entries to the web.config without any trouble. I added the ScriptManager control to one of the pages and an UpdatePanel. I also had to set a reference tosystem.web.ui. System.Web.Extensions However, when I try to drag some of the asp.net controls already on the page (drop down boxes) to the update panel, it does not seem to be accepting them. They are not "dropping into" the update panel. The panel does not highlight when I drag the controls over it.

What am I missing?

EDIT: The reference I set was System.Web.Extensions...not web.ui.

Apart from working with the Designer, have you tried working around in the HTML to see if its working?

Wrap your controls with the UpdatePanel and see if the page is working.

-Thanks


It's hard to tell without seeing the web.config, etc. The easiest way (and the method I used) is to create a new project, and view the differences between the web.config files and references.

I copied all of my project-specific settings (the ones that I added myself) to the web.config for the new project, then copied the resulting file to my actual upgraded project. It worked for me!

Just be sure to make backup copies of the old web.config, just in case you need to revert.


ravivb.net:

Apart from working with the Designer, have you tried working around in the HTML to see if its working?

Wrap your controls with the UpdatePanel and see if the page is working.

-Thanks

I have not tried that appraoch yet, however I will give it a try. thank you for your response.


ps2goat:

It's hard to tell without seeing the web.config, etc. The easiest way (and the method I used) is to create a new project, and view the differences between the web.config files and references.

I copied all of my project-specific settings (the ones that I added myself) to the web.config for the new project, then copied the resulting file to my actual upgraded project. It worked for me!

Just be sure to make backup copies of the old web.config, just in case you need to revert.

I will give this a try. I originally did it the other way around (copied web.config entries from the emtpy project to my project). Thank you for the response.


wjdunn3:

ravivb.net:

Apart from working with the Designer, have you tried working around in the HTML to see if its working?

Wrap your controls with the UpdatePanel and see if the page is working.

-Thanks

I have not tried that appraoch yet, however I will give it a try. thank you for your response.

This approach worked. I added the Script Manager and Update Panel to the Page then switched to HTML view. I moved the Script Manager tags to be just under the first FORM tag. I wrapped the code I wanted in the Update Panel tags and *important part* ContentTemplate tags.

I don't know why it does not work within the designer...I will have to try and figure that out another day. Thanks all for the quick responses.

Saturday, March 24, 2012

Ajax and querystring parameter

Hi,

I am developing a new application with Ajax.

I must create a new aspx page that have two mode: "view" or "modify" and show some products based on their ID.

In not Ajax context I use the query string with parameters to change the mode and the ID of products and it is very simple. I change the query string using Response.Redirect("same page + new paramaters")

With Ajax I think to use some session variables to manage the mode of page and ID of products...

Is the correct solution?

Since the view/modify is likely tied to the authenticated user, I'd suggest use encrypted ViewState variables to store the productid and page mode. It won't expire compared to the SessionState.


Ok, but I have the necessity to pass some values (modify/view, productId) to this page.

Is the viewstate accessible between pages?

If I store an object in viewstate and then there is a redirect to a new page, is the object value accessible from new page?

Thank you.


I am using the session to tranfer object between pages and then I use the viewstate for postpack in the same page.

I have a problem.

I click in a button and in onclick method I change viewstate "mode" value from "view" to "modify"...

When in the Page_Load event I test the value of viewstate mode, it is still "view" instead of "modify". The viewState value change only on next postback...i must click two times to change page modality from view to modifiy.

How can I resolve this problem?


Ok, I have inserted the check in the Page_PreRender method and now it is working fine.

I did not remember that any code that is dependent on a control event should be put into PreRender method.


If you need to keep variable value between pages, using sessionstate is one solution, keep in mind that session will expire. You can also use database to handle temporary data storage. A new feature in ASP.NET 2.0 is the postback to another page, read this article to see if it fits what you wanted:http://msdn2.microsoft.com/en-us/library/6c3yckfw.aspx

For viewstate, it only belong to the current page. The value will not be carried over to another page.

AJAX and mobile device problem

I have a web application that needs to go and check a webservice on timed basis for some data. If the data exists I want to get the data and then navigate on the cient to another page. I initially got this working on normal internet explorer on my pc using the ScriptManager, and an update panel with an AJAX timer on it. This way the timer would not cause a full page rendering. When the timer fired he would check the webservice and then navigate on if the data existed.

Then I tried this on a Windows Mobile 5, and 6 device to which it appears the timer never fires. I simplified my code by updating a label when the timer fires and this doesn't happen either. So my conclusion was that the AJAX timer does not work on mobile devices. How can I accomplish the same task in another way without a complete page refresh on interval?

Thanks in advance

Steve

Here's some information on AJAX and Windows Mobilehttp://blogs.msdn.com/iemobile/archive/2005/11/15/493200.aspx andhttp://blogs.msdn.com/iemobile/archive/2007/07/03/another-ajax-sample-for-ie-mobile-plus-json-and-asp-net-ajax-tips.aspx. Nothing specific about the UpdatePanel though...

-Damien

AJAX and IE7

I am using ASP.NET 2.0 AJAX and IE7.my application doesnot work.But if i run the same application in IE^ its working.

Why is it so.Is there any problem with IE7 and AJAX working.

Hi,

which problems are you experiencing? Which version of AJAX are you using (CTP, Atlas, Extensions 1.0, another AJAX framework)?

Could you also provide the least amount of relevant code to reproduce the problem? Without that it's going to be difficult to help you out.

Grz, Kris.

Wednesday, March 21, 2012

Ajax and GridView Control

I have to Update Panels in my application and i want to make everything work with the code not with the GUI. So when i click insert button it should insert the data from the textboxes to the database and in UpdatePanel2 i want GridView to be automaticly updated. It inserts the data but does not update the GridView , so here is the C# code that i wrote for it

1protected void Page_Load(object sender, EventArgs e)2 {3if (!Page.IsPostBack)4 {5 dataGetir();6 }7else8 {9 dataGetir();10 }1112 }1314protected void dataGetir()15 {16 SqlConnection conn =new SqlConnection("Server=localhost;Database=Calisma;Trusted_Connection=True;");17 SqlCommand cmd =new SqlCommand("Select * From Calisanlar", conn);18 SqlDataAdapter da =new SqlDataAdapter(cmd);1920 DataSet ds =new DataSet();21 da.Fill(ds);22 GridView1.DataSource = ds;23 GridView1.DataBind();24 }25protected void btnInsert_Click(object sender, EventArgs e)26 {27 SqlConnection conn =new SqlConnection("Server=localhost;Database=Calisma;Trusted_Connection=True;");28 SqlCommand cmd =new SqlCommand("insert into Calisanlar(FirstName, LastName) Values(@dotnet.itags.org.First, @dotnet.itags.org.Last)", conn);29 SqlParameter prmFirst =new SqlParameter("@dotnet.itags.org.First", SqlDbType.NVarChar, 50);30 prmFirst.Value = txtIsim.Text;31 SqlParameter prmLast =new SqlParameter("@dotnet.itags.org.Last", SqlDbType.NVarChar, 50);32 prmLast.Value = txtSoyad.Text;3334 cmd.Parameters.Add(prmFirst);35 cmd.Parameters.Add(prmLast);3637 conn.Open();38 cmd.ExecuteNonQuery();39 txtIsim.Text = String.Empty;40 txtSoyad.Text = String.Empty;41 conn.Close();4243 }44protected void btnCancel_Click(object sender, EventArgs e)45 {46 txtIsim.Text = String.Empty;47 txtSoyad.Text = String.Empty;48 }

And here is the source code that i wrote for the panels

1<form id="form1" runat="server">2 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />3 <div>4 <asp:UpdatePanel ID="UpdatePanel1" runat="server" >5 <ContentTemplate>6 <table style="width: 200px; border-width: 0px; background-color:Blue;">7 <tr>8 <td style="width: 4px">9 <asp:Label ID="Label1" runat="server" Text="?sim"></asp:Label></td>10 <td>11 <asp:TextBox ID="txtIsim" runat="server"></asp:TextBox></td>12 </tr>13 <tr>14 <td style="width: 4px">15 <asp:Label ID="Label2" runat="server" Text="Soyad"></asp:Label></td>16 <td>17 <asp:TextBox ID="txtSoyad" runat="server"></asp:TextBox></td>18 </tr>19 <tr>20 <td style="width: 4px">2122 </td>23 <td>24 <table style="width: 150px; border-width: 0; background-color: Blue;">25 <tr>26 <td style="width: 33px; height: 26px">27 <asp:Button ID="btnInsert" runat="server" Text="Insert" OnClick="btnInsert_Click" /></td>28 <td style="height: 26px">29 <asp:Button ID="btnICancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" /></td>30 </tr>31 </table>32 </td>33 </tr>34 </table>35 </ContentTemplate>36 </asp:UpdatePanel>37 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">38 <ContentTemplate>39 <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">40 <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />41 <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />42 <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />43 <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />44 <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />45 <AlternatingRowStyle BackColor="White" />46 </asp:GridView>47 </ContentTemplate>48 <Triggers>49 <asp:AsyncPostBackTrigger ControlID="btnEkle" EventName="Click" />50 </Triggers>51 </asp:UpdatePanel>5253 </div>54 </form>
So i am so confused about Ajax, thanks for your helps

You need to open the connection to your database for it to send the query. One way to check this is by using the Sql Profiler inside of the SQL Server Management Studio under the Tools menu. That could help you diagnose in the future a problem like this.

To fix modify you code like so:

16 SqlConnection conn =new SqlConnection("Server=localhost;Database=Calisma;Trusted_Connection=True;");
17 SqlCommand cmd =new SqlCommand("Select * From Calisanlar", conn);
18 SqlDataAdapter da =new SqlDataAdapter(cmd);
19
20 DataSet ds =new DataSet();
21 conn.Open();
22 da.Fill(ds);
23 conn.Close();
24 GridView1.DataSource = ds;
25 GridView1.DataBind();

Also in your Page_Load routine you shouldn't really call the binding sub routine in both conditions. You really don't need the IF statement because it runs everytime no matter what.

It should look like this:

3 if (!Page.IsPostBack)
4 {
5 dataGetir();
6 }
7 else
8 {
9 //Nothing here
10 }

Let me know how that works.

JoeWeb

I modified the lines like you said. But it didn't work i mean it inserts the data into database but it doesn't refresh the GridView. When i refresh the whole page then the GridView refreshes too. I guess there is something wrong with the source code. Because normally the code that i wrote insterts the data and selects the data no problem. The problem is in the Update Panel i guess?

Mehmet Serif


You are doing an AsyncTrigger... with this control btnEkle

I don't see you referencing that control anywhere in the frontend code. You need to put that button inside the updatepanel enclosing the gridview for the updatepanel to be triggered for an update. Otherwise just remove the asynctrigger and it will update the panel nonetheless.

JoeWeb


btnEkle is already referenced in UpdatePanel2 as an AsyncTrigger control with its Click event..and btnEkle button is in UpdatePanel1 and should trigger the UpdatePanel2..if you say it's not referenced to anywhere then how can i reference it?

Thanks


I think what he's saying is that in the code you pasted in this thread, there's no button called btnEkle.
oh yes you are right but in its original code there is no btnInsert instead there is a btnEkle so no problem about the buttons..

Would you mind pasting the actual code you're using (since this apparently wasn't it)?

My best guess without being able to see the code is that you need to call DataBind() on your DataGrid in your click event handler.


ughnn i forgot to call dataGetir() function in Click event of btnEkle button. Thanks for the help..

AJAX and Forms Authentication

Hi

I'm just starting to look at building AJAX functionality into our existing ASP.NET 2.0 web application. The web app is a portal-type application and uses Forms Authentication and the ASP.NET Membership/Profile providers to manager users.

I've followed through the tutorial videos and successfully AJAX-enabled a grid view on one of the pages which is filtered by a drop down list. I've also added an UpdateProgress tag which seems to work fine. The problem arises when a user changes the value in the drop down list after the forms authentication ticket has expired (which is currently set to 30 mins). Without AJAX, any change in the drop down list first redirects back to the login back, then posts back the original page to show the newly filtered gridview. Howvever, with AJAX, the first change to the list appears to simply redraw the existing grid data (regardless of what is selected), and subsequent changes result in the following browser/client error. The status code varies between 12030 and 12031 on different runs of the application.

--------
Windows Internet Explorer
--------
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030
--------
OK
--------

I've searched around these forums, google, the online help etc. and it appears that you can use AJAX to control logins via forms authentication which implies that it must be possible to achieve what I'm after. However, so far it looks as though the AJAX callback is not respecting/using the forms authentication ticket.

Could anyone elighten me as to how AJAX callbacks work with forms authenticated sites and why this particular error message is occuring.

Best regards

Craig

Thanks for the link, I had a quick read through this yesterday, but there's been quite a few posts added in the last 12 hours or so.

I'm not sure it sounds exactly the same, but it could be related. As I said, I'm new to AJAX, so have only ever installed the RTM version and haven't tried anything earlier. My (limited) experience with update panels and logged-in users (via forms authetication) was that everything works fine until the authentication cookie expires - that's when the error occurs.

I'd be interested to know, from those who've used pre-RTM versions, what the expected behaviour should be. If an AJAX callback is made once the forms authentication cookie has expired, does the page redirect to the login page as with normal postbacks?

Thanks, Craig


Hi Craig,

This is an issue that has been introduced with the AJAX RTM. Several others of us are experiencing it but we haven't found a solution yet. We have a thread going about it at:

http://forums.asp.net/1553437/ShowThread.aspx#1553437


Yes, that would be the expected behavior.

The problem that I and others are seeing appears to be related to role caching though, not to cookie expiration.


Hi,

I had this exact same issue and found that it was related to the page validation and some hard coded text in a text box that contained "dangerous" characters. I had a textbox that had hard XML in the text area. Without the AJAX update panel, it would throw a warning error. With the AJAX update panel, it would throw the error you saw.

What I did for my testing purposes was switch the validaterequest to FALSE in the page declaration, and this fixed it. I know this is not ideal, but at least points to what the root cause is.

ValidateRequest="False"

Jason

Ajax and file downloading

Dear all,

First of all, sorry for my english. I'm french !

I have developped an ASP.Net 2.0 web application. It allows to get data from 2 databases and merge them into a "csv" file. When the user presses the button Process, the execution can take several minutes to accomplish. Because file's size could be large, I used the recommended method of Microsofthttp://support.microsoft.com/kb/812406/en-us.

Thus, I wanted to use a method giving informations to the end user about the current process. I found the Ajax libraries, ie the updateprogress control which appears to be powerful. I installed the 1.0 version and add the references to the project. Everything works fine for the different examples giving in the tutorials.

Hence, I applied these methods on the page and executed the project. I got error messages on the client side when the user clicks on the button Process. Is there someone who has an idea ?

This the error message :
Client side error message when a file is going to be downloaded

Thank you for your help.

Best regards

Antony

If you reviewe the text of the error message, I think you'll find one of the suggestions is correct.

David Anson:

If you reviewe the text of the error message, I think you'll find one of the suggestions is correct.

Indeed, you're right, because I do not use Response.Write or something else equivalent. Otherwise, I don't how to bypass or use something diffferent... Thus, could you help me ?

I'm beginner in ASP.Net.

Best regards,

Antony


Does anybody have an idea?

Best regards,

Antony


So you're using the first method described in the link you provided but not Response.Write? What are you using then because thats whats in the article?

I made a mistake in my answer, I'd write "I should not use "Response.Write" instead of "I do not".

I effectively use the method provided by microsoft for dowloading udge files. However, it gives me the error when I use with ajax controls as updateprogress.

Antony


Thanks to the utility Web Development Helper, which allows you to get information that are posted back and received from the server, I found that only some partial part of the page was sent to the client in html code. Thus, I did not do it but I think that if you send via the Response.Write, a link to the files recorded on the server, thus, it would work and allows you to download files with Ajax.

If someone has the time to try. When I'll get some, I'll try myself.

Antony

Ajax and Embedded Linux

Hi,

I want to build an AJAX application that will run both on Windows XP/Vista using IE and FireFox and on Linux Embedded machines using Mozilla.

Are you familiar with such a solution?

Thanks,

Janiv Ratson.

Microsoft Ajax 1.0 supports both IE and Firefox.