Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts

Wednesday, March 28, 2012

Asp.net Ajax Toolkit

Hi, i'musing Ajax 'DynamicPopulateExtender' to show the search results on my page. This is working fine when the search has results. errors 'Web service call failed : 500' when no results found. Can someone help me out?

Hi,

According to your description, this is quite probably caused by your code in the web service. It would be easier to solve it if you debug through the web method since we don't have any idea how your code goes.


Thanks. This is occuring bcz of unhandled exception in the webservice code.

ASP.NET Ajax Timer

Greetings,

i want to implement ajax timer so it will update an updatepanel every five seconds based on a certain codition so i try the following:

<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>

</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="UpdateTime">
</asp:Timer>

in the code behind i write the folowing:

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToLongTimeString();

}
protected void UpdateTime(object sender, EventArgs e)
{
if (new Random().Next(0, 4) == 1)
{
UpdatePanel1.Update();
}

}

so what i notice that every five seconds the tick event will happen and the updatepanel1 will be updated regardless of the condition that i implement it in the UpdateTime method ,what is logic since the tick event happens.

so how can i solve this problem??

your help is highly appreciated

best regards

I tested your codes in Visual Studio .Net 2005 with Ajax RC 1.0.Try to change some of your codes as the following and it should work fine.
<div>
<asp:UpdatePanel ID="upnlTimer" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTimer" runat="server" Text="Date Time"></asp:Label>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
</div>
Wish the above can help you.

Thank you for the support

so what i add only the

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="UpdateTime"></asp:Timer>
</ContentTemplate>

</asp:UpdatePanel>
</div>

so when i place the timer control within the contenttemplate of the updatepanel so i dont need to put the timer control within the triggers of the updatepanel

so what i conclude that it will not work if i place the timer control outside the update panel.

ASP.net AJAX throws errors in some browsers

These browsers are:

Mozilla (latest version)
Seamonkey (latest version)
Netscape (latest version)

See this error message:

AJAX error in diverse browsers

Has anyone encountered the same problems in the mentioned browsers? I couldn't check Mac browsers, any known issues in Mac browsers would be interesting too.
Any other browsers that don't like the asp.net AJAX?

This is normallly because you modify the response by using Response.write.Make sure you use a Literal control instead of using response.write.

Mac browsers will have the same error.

It's also possible that the error is caused by Tracing where the pageoutput is set to true. You must set that to false.
<traceenabled="true"requestLimit="128"pageOutput="false"traceMode="SortByTime"localOnly="false"/>


Hi Richard,

thanks for your reply. So I may not use <%= WhateverString %> neither, right? I can't use Response.Write in my code behind files and neither in the "HTML" source code, is that what you are saying?

Steve


Hi Steve,

Yes that is what I meand. I hope it helped you.


To be clear, <%= is just an alias for Response.Write; so there's no differnece at all once it compiels. If it helps, you *can* use Response.Write, just not inside an UpdatePanel, nor as part of any code that will be subject to responding to an update panel's asynch postback.

Asp.net ajax support SSL?

Hey, I released a ajax-based project on live server recently, everythings is fine. (Asp.net ajax v1.0)

But when I turn on the SSL tunnels on app's virtual directory, Ajax doesn't work any more.

for example, a GridView paging functionality within a UpdatePanel, after a long-time loading, it throws timeout exception at client side. (same func works fine under non-SSL).

Can someone give me a tips about how to make Ajax work under SSL? All reply is appreciate!

helo.

are you mixing http with https on the same site or is everything running in https? btw, can you put the stack trace here?


code is very very simple, just GridView paging func under UpdatePanel.

only popup a alert window. here is the screenshot.

Error screentshot


hello again.

hum, can you use fiddler to see what is being send to the server?

ASP.NET AJAX Showcase image rollover ?

I was wondering if anyone knew how the image roll-over was accomplished on the ASP.NET AJAX Showcase page?

http://ajax.asp.net/showcase/default.aspx?tabid=47

Thanks

http://forums.asp.net/1671436/ShowThread.aspx

Prior to making your own post, I recommend searching the forum for existing posts which may answer your question. Smile

ASP.NET AJAX scripts weight

Hi, I'm working with a extremely high bandwidth sensible servers (more than a million pages views per day) and I want to know about the convenience of working with ASP.NET AJAX.


I've seen that everypage with ASP.NET AJAX downloads a JS file (webresource) of more than 80Kb (compressed)... and 80Kb x 1.000.000 = 80 Gb/day...


On the other hand, I know that the user experience is improved, but... what about the server performance?

I only want to know your experiencies on this way: bandwith and server performance with high charge servers.

Well, it's actually 3 files, totalling 134,473 KB, though I checked it w/o GZIP turned on, so I'm not sure how much you gain with it; one of the three doesn't have the whitespace, etc removed already. For argument's sake and round numbers, let's call it 100KB / page.

So, to your point, that's x 1,000,000 so you're looking at 100 GB/day. IF every one of those page loads is a unique user.

Don't forget, if a user navigates within your site, or has been to your site before, their browser should cache those js files and therefore they'd only get hit with that download the first time they come to your site or if they've cleared their cache.

Further, not only is user experience improved, but take a basic webform as an example. If you have a 8 KB page with a form on it, and the user submits said form, then on a normal postback the whole page is served again (all 8KB). If you wrap that form in an updatepanel, then only the form itself is served in response (probably something around 10% of the total page's markup, etc, once you strip out headers, script tags, other sections of the page, and so on). If you forego the updatepanel and write custom js that hits webservices and so on instead, you can potentially reduce it even further (having the web service respond with just the "Everything's great!" message, for example).

I've honestly not done an impact analysis on many small requests, vs. few big ones, so that's an open item for you to investigate, but from a bandwidth perspective, I think you're overall in better shape, unless you have a lot of visitors that are 'first time' visitors from the .js file download perspective.

ASP.NET AJAX ScriptManager

Hi,

I am a total newbee to whole AJAX as well as Javascripting in general. I just installed the ASP.NET AJAX Extensions and Toolkit and I was watching couple of videos on this site. The first video mentioned something about only having 1 instance of the ScriptManager..?

This is how we develop at the moment. We have a general page on which we just drop ASCX (User controls). Each control has thus it's own Load event and all along with it's own design with few controls in it.

So where do I need to drop this ScriptManager control? On every ASCX file?

Cheers,

Nirav Patel

Nirav,

If you have a MasterPage in your website, and you'll be using AJAX on every page then the MasterPage is theonly place where you would drop the ScriptManager control.

Otherwise, you would drop the ScriptManager control to your "general".aspx page.

Let me know if you need more info.


Thanks for a quick reply.

We don't have a master page type of setup nor we have a general page.

What we have is a template where we define section of the page like "header", "content" (this might have "left" for menu, "middle" for contect, "right" for ads), "footer". Then ASCX are inserted into those sections as required.

So can I just modify the template and add the ScriptManager at the top?

Cheers :)


niravpatel:

This is how we develop at the moment. We have ageneral page on which we just drop ASCX (User controls).

The term 'general page' I used because you used it in your original post.

The fact is that there can only be one instance of ScriptManager control per page. This is why you must place the ScriptManager control in a parent .aspx page. If the user controls need to reference a script or a service, then you can use ScriptManagerProxy control in your .ascx controls.


Hiniravpatel,

You should add it after the <form> tag.

<html>
<headrunat="server">
<title></title>
</head>
<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>
</form>
</body>
</html>

Otherwise you will get the following error:

Server Error in '/' Application.
------------------------

Control 'ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.

Cheers,
Al

Asp.Net Ajax Script Library Books

Hi. I think it's going to be quite hard to find books that wil cover only the client-side part of the Asp.Net Ajax Library, but I'm looking for, at least, some books that will have a great emphasis in the client-side part. Can anyone suggest some books that will target the client-side part of the Asp.Net Ajax Library?

ASP.NET Ajax in Action covers the client-side library pretty well. Have a look at the sample Chapter 2 here:http://www.manning.com/gallo/


Hi. Just finished reading the Chapter 2 of ASP.NET AJAX in Action.
This book appears to be a serious one! It's very well written.

But in case someone else have read another good book that target the
cleint-side library, please post here.


Have a look at

Programming ASP.NET AJAX http://www.oreilly.com/catalog/9780596514242/

ASP.NET AJAX Sample applications - SimpleList

Hi,

I also just started learning ASP.NET AJAX for real and I wanted to check out theSamples that one can download. I thought using the SimpleList would be the easiest but I soon found out that when you want to run the DragOverlayExtender began complaining. Seemed the web.config isn't complete. I added these extra lines in order to get it to work:

 <profile> <properties> <add name="dragOverlayPosition"/> </properties> </profile>

and

 <profileService enabled="true" readAccessProperties="dragOverlayPosition" writeAccessProperties="dragOverlayPosition" />

I hope this helps other people out that are just starting to play around with the samples

If you like to read more about it...

Grz, Kris.

Thanks for sharing Kris...Please continue to do so.

Salute,

Mark Wisecarver

asp.net ajax refresh the UpdatePanel every 30 sec?

I am currently using Timer control inside my update panel to update automatically every 30 sec. However i wanted to use json to do the same thing.

Any suggestions?

Thanks

Hi,

JSON (JavaScript Object Notation) is a lightweight data-interchange format, or it can be viewed as a protocal defining how object is serialized when transporting.

It can't be used to perform actions at a certain interval like Timer.

Please refer to this for more information:http://msdn2.microsoft.com/en-us/library/bb299886.aspx

Hope this helps.

ASP.NET AJAX RC on PROD server is not working

Hi

I have a sample ASP.NET AJAX application built using ASP.NET AJAX RC. it AJAXes and it does behave as expected on VS 2005. When i deployed it on my local server. It does not AJAX and get the following javascript error

Error:'Sys' is undefined

am running XP Pro, SP2 & IIS 5.1. earlier i had not installed any beta releases or ATLAS. i dont see what is going on.

thanks in advance for the help

Anil

7 pages of posts just like this, lots of solutions and things to try in there

http://forums.asp.net/thread/1498667.aspx

ASP.NET Ajax Progress Bar Revisited

I'm trying to create a Progress Bar that keeps track of a long running server-side process. I'm attempting to do this by having a primary ajax request start the server-side process, then having another polling function occassionally call back to the server via ajax to return the status if the server-side process started with the first ajax call. The problem is that the second ajax call doesn't return until the first one is completed.

Consider the following client-side code:

PageMethods.Execute(ExecuteCallback);

intervalId = window.setInterval(ExecuteStatus, 1000);
var done = false;

function ExecuteStatus()
{
PageMethods.ExecuteStatus(ExecuteStatusCallback);
}

function ExecuteStatusCallback( status )
{
<update progress bar>
if( !done )
window.setInterval( ExecuteStatus, 1000 );
}

function ExecuteCallback()
{
done = true;
}

PageMethods.Execute() is a server side process that can take a considerable amount of time. As it executes, it is setting a Session variable which indicates the status and completion percent of the process.

PageMethods.GetStatus() is a simple server side function which reads the aformentioned Session variable, and returns the status to the client.

The problem is that PageMethods.GetStatus() doesn't return until PageMethods.Execute() has completed and called back to the client.

Any ideas how to make this work?

Thanks much,

- Stew

I think you mean setTimeout instead of setInterval. Here's a working example. I hope this helps!

<%@. Page Language="C#" %><%@. Import Namespace="System.Web.Services" %><%@. Import Namespace="System.Threading" %><script runat="server"> [WebMethod] public static void Execute() { Thread.Sleep(5000); } [WebMethod] public static string ExecuteStatus() { return "."; }</script><!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 runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="sm" runat="server" /> <input type="button" value="Execute" onclick="DoExecute(); return false;" /> <span id="status">Ready.</span> </form></body><script type="text/javascript"> var done = false; function ExecuteStatus() { PageMethods.ExecuteStatus(function (result) { if (done) { $get('status').innerHTML = "Done!"; } else { $get('status').innerHTML += result; window.setTimeout(ExecuteStatus, 1000); } }); } function DoExecute() { done = false; PageMethods.Execute(function () { done = true; }); $get('status').innerHTML = 'Executing'; window.setTimeout(ExecuteStatus, 1000); }</script></html>

Steve, thanks for the response. Yes I did use setTimeout; I made a mistake when I typed the message above. I'm not sure why your test would work and not mine, but I'll take a look when I get home on Monday.

Thanks again

- Stew


Steve,

Try setting a session variable in your test before executing the test. This is what appears to be causing the problem.

- Stew

ASP.NET Ajax Probelm

has anyone else tried viewing a page that has an updatepanel in different browsers like Opera. It doesn't work I get the following exception

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

might be something that the team wants to look into. I dont' have a probelm with firefox or netscape

hello.

if i'm not wrong, opera isn't fully supported yet (though i'm really hoping that it is when the release version gets out)

ASP.NET AJAX PageMethods

I would like to call a server side method from javascript, and have read that this is where PageMethods comes into the picture.

I would like to call my method when a Virtual Earth map onLoad event has fired.

I have problems with PageMethods as the method called serverside has to be shared and therefore i cannot reference my controls.

Is there other options ?

You can't access page controls in a page method, because a page method request doesn't transmit ViewState or run through the page life-cycle to create the controls.

If you really need to reference the controls, you canuse an UpdatePanel and __doPostBack to trigger a partial postback (which does allow you to reference the controls).


You can also pass clientside state through parameters if needed.

ASP.NET AJAX on non-Windows platform

There is a strong implication that ASP AJAX can be used on a non-Windows platform, such as Linux. I downloaded the .zip file and un-zipped it. The resulting JavaScript is tightly compressed and thus unreadable. Where can I find the API (loosely speaking); or, in other words, how can I use it?

Hi,

the Microsoft AJAX Library, just a zip file with several .js files in it, contain the client sideframework of ASP.NET AJAX. All the .js files also come with their debug counterpart which have .debug.js in their name.

Maybe some interesting article for you is to usePHP together with the Microsoft AJAX Library.

Grz, Kris.


Thank you. The info in that article was the missing link. I've yet to try it, but I'm sure it will work.

Now that I've had time to check it out, that paper is a little too simplistic. I downloaded and ran the PHP samples, and once I figured out how to tell my web host that it was PHP 5, not 4, they ran just fine.

Unfortunately, I don't know how to move beyond the simple "Hello World" page to somthing more useful.Some explanation of what's going on in HelloService.php and PersonService.php would be very helpful. Or how about converting the ToDoList demo to PHP MS AJAX? That would offer some meat to chew on.

Thanks in advance for the help!

ASP.Net AJAX on hosted server

Forgive my ignorance here, I've goggled extensively and looked through the forums here and have not found an answer to my question. I'm hoping to play around with ASP.Net AJAX on a hosted server here on campus, however, I don't have permissions on the box to install the AJAX extensions. I believe that I am out of luck here, but I just wanted to check if I had any options other than running the off my local machine. Thanks!

You should be able to put the AJAX .dll file in your bin folder just like with the ATLAS setup. I have set AJAX up on a hosted server in this manner without problems, or installing anything in the server's GAC. The .dll files are installed into your local GAC by default, but are also placed on your local machine. Mine were in Program Files\Microsoft Asp.Net\AJAX Extensions or something close to that (I'm not at home so I can't check). Just make sure you have your web.config setup properly it should work. If you do have the AJAX stuff installed into your local GAC you will get an error when testing locally because all the classes will be duplicated. I resolved this by only placing the .dll file in the bin folder on my server and letting the my local GAC serve up the classes when testing locally. The only other problem I ran into was because one of the server's I tried had restrictions on accessing parts of the .Net framework, specifically I couldn't use Reflection which is used by AJAX Extensions. Hope this helps.
Seriously, people.. There are probably 50 posts here that re-iterate the same about this problem.. OMG...

Thanks for the replies, sorry for not seeing this elsewhere... I've got it working now, the problem that i was having, so far as i can tell, was that the web.config that i had in the root of the application was not configured for AJAX... the web.config that i had in the same folder as the AJAX enabled page was the one that i had added the appropriate lines to, once i changed the web.config in the root of the app, all was well.

Sorry for wasting anyones time...

ASP.NET Ajax on GoDaddy?

Does anybody know if GoDaddy has installed the ASP.NET Ajax v1.0 yet?

When Ajax was released, on the second day I emailed GoDaddy and asked, they said they have not install it yet and do not know when. I hope GoDaddy will install it soon else I have to move all five accounts off their server and go somewhere else.

*disappointed ~ would love to see the new ajax running

Aeries

From my understanding, you do not need AJAX installed on the server you will be using. Just add the Ajax dll's inside of the bin folder. I also uploaded a new AJAX project I just completed on our production server and it worked. Im 100% sure that doesnt have AJAX installed on it.

Hope this helps.


For that to work (copying to /bin), your application needs to be running under full trust. I really doubt GoDaddy allows that.

GoDaddy definitely don't allow apps to run under fulll trust - it's set to medium trust. As far as when they will install the AJAX components? The response I received from them was: "Unfortunately at this time we are unable to say when we are going to update our servers to support ATLAS. I apologize for any inconenience this may cause." I received this response on the 26th of Jan, so it's recent. (Can you believe they are still calling it ATLAS?!).

I'm starting to become seriously concerned about the adoption of ASP.NET AJAX by hosting providers. I have now tried to convince 3 different hosting providers to install it but all responses have been negativeSad

There are some providers who do support AJAX though - DiscountASP [http://www.discountasp.net/ ] and webhost4life [http://www.webhost4life.com/ ] but I really don't want to have to choose a provider just because of this one AJAX library.

Jits


First of all,

I did try putting all the DLLs in the bin. Some functionalities work, but others do not, because of the medium trust that is set for the account(s). GoDaddy does not and will not set your account runs as full trust, because it will violate their policy; unless you buy a dedicated server from that. *That is very disappointed.*

I have searched for hosting providers who already installed AJAX, however, their price isn't as good as GoDaddy. I think I will give them a little more time.

I think if all of us keep emailing them about the AJAX (not ATLAS anymore), hopefully they will understand how important it is to install Ajax on their server for their customers who are using it.

I will shoot them another email February 1st again. I will update with you all.

Aeries


Hi,

I just would like to help!

I guess if you're looking for a nice service provider, even better than webhost4life, you should go towww.micfo.com!

They have asp .net 2 and all their plans support unlimited add on domains and I guess they have full trust security level, so you can easily use ajax on their servers...

Regards,

HRS


Okay, I dropped GoDaddy another email this morning. Here's what i wrote:

Dear GoDaddy,
I have written to you regarding this ASP.NET Ajax v1.0 last month. I did get a reply from your department; however, the problem is not resolved yet.

ASP.NET Ajax v1.0 has been fully released by Microsoft last Month 01/23/2007. It is a major role for web developers and it's something new that drives us forward.

Many people sign up with GoDaddy, because of the price and great customer supports. The most important thing is GoDaddy is very technology wise. You have all the new technologies that developers need to run their applications, like .NET 2.0 Framework, SQL, etc….

I know that you will eventually install the ASP.NET Ajax v1.0 on your Windows Hosting Servers sometimes in the future; but why not now? There are many developers who are anxious to run their new applications on your servers, including me.

Many hosting providers already support ASP.NET Ajax v1.0. We hope that you do the same for everybody who is impatiently waiting. We don't want to pack and move and you don't want us to move either.

Please let us know when ASP.NET Ajax v1.0 will be installed at www.asp.net, on your eNews page, a good place is within this thread: http://forums.asp.net/thread/1556314.aspx. You also can search for "GoDaddy" at that website to see others who have problems with GoDaddy. There are already recommendations of other providers who support ASP.NET Ajax.

Thank you again.

They replied:

Dear Xxxxxxxx

Thank you for contacting Online Support. We are not able to provide a specific date for when this will become available. It will be listed on our website when it is available. If you have any other questions or concerns, you may contact us at any time.

Please let us know if we may be of further assistance.

Sincerely,

Beth P.
Online Support Technician

It looks like they don't know when it will be. But looks at this site if you're eagering to get your Ajax website running. www.webhost4life.com. I went down their "Advance Plan" for Windows Hosting plan, and it looks like they have everything that a developer needs. .NET Mobil, SQL 2005 for FREE, .NET 3.0 ... everything. The only thing is, the price isn't as good as GoDaddy.

I might consider them if my project is done and GoDaddy hasn't install the Ajax yet.

Aeries


Reply on Wed, 7 Feb 2007

"Hello.

ASP.NET AJAX is not installed in our Windows shared hosting environment. We are currently evaluating how best to support these new libraries. By default, they require Full Trust to execute, which introduces potential security risks that must be mitigated before we can deploy AJAX support.

Thank you for contacting customer support.

Sincerely,

Mike
Customer Support"


FYI, that's untrue. ASP.NET AJAX requires only Medium Trust, which is probably what they're already running people's sites under.

I'll ping the folks here at Microsoft and make sure someone from Microsoft is talking to GoDaddy about the technical details. (I'm sure they are, and it just hasn't filtered the whole way to their support team yet.)


If it's medium trust, does that mean that the DLLs can be run from the BIN folder?

by the way, if anyone is wondering ifwww.1and1.com has ajax installed, the answer is yes. I emailed them two weeks ago and they just replied today.


Trywww.dhosting.co.uk

They've got excellent deals, have AJAX, .Net 3.0 and the support is excellent. I was reffered to them from this forum, and have been very pleased. Thanks Chris!


It's Medium Trustif the binaries are installed in the GAC.

If they're in the /bin folder, then Full Trust is required.

FYI, Microsoft folks are working with GoDaddy.


Steve,

You're the best! Cheer.

Can't wait for them to get it installed.


I have the solution for you!

Place the following dlls from C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025 into your applications bin.

AJAXExtensionsToolbox.dll
System.Web.Extensions.dll
System.Web.Extensions.Design.dll

They came with the new install of AJAX.

Also we have to make sure that in our web.config under assemblies the PublicKeyToken portion is all Caps!

Good
PublicKeyToken=31BF3856AD364E35
Bad
PublicKeyToken=31bf3856ad364e35

You do this and it will work on godaddy.com sites!


SERIOUS? I gotta try it out.

ASP.NET AJAX Obfuscator?

Is there any such thing? or ASP.NET Javascript Obfuscator!!!

Please help me out here!

hmmm....no such thing?

ASP.NET AJAX not working in IIS 6.0

I have a scenario where my AJAX application is not working in IIS but is working correctly in ASP.NET Development server. I dont understand the difference between these two except for the context in which the application runs. Am I missing any setting. I tried checking web.config and reconfirmed it to be correct when I found this application working on ASP.NET Development server.

help me in this-----

Hi,

first: AJAX working on IIS 6, i have a production application in this environment without any problems.

Have you got installed the ASP.NET AJAX framwork or have you only copy the DLL into the bin directory?

What kind of error messages comes up? Can you explain the errors you have?

Have you setup the application inside the IIS correct, configured the right ASP.NET Version?

Regards
Marc André

ASP.NET AJAX not working for me??

Hi,

I am having a problem that is driving me crazy. I currently have my ASP.NET 2.0 website hosted with a hosting company and they claim to have AJAX extensions installed on their servers.

I created an asp.net page, put a simple label and button in an UpdatePanel, set the updatepanel to "Conditional", and yet is still causes a full page refresh when the button is clicked. I tried uploading the same exact page with same web.config to another web server I have and it worked properly there. What could be wrong with the hosted site and how can I fix it?

To further test the hosted site, I added some Controls from the Ajax Control Toolkit, such as Collapsible Panel, and that seemed to be working correctly even though the updatepanel is not. I even uploaded the DLL's to the bin folder.

What else can be causing this problem? I even have a different subdomain with the same hosting provider that seems to be running this page correctly. What settings can you think of that I should mention to the hosting company to fix them. I already alerted them of the problem and they believe they are doing everything correctly and that the problem lies on my side (which makes no sense to me since I know the code is fine since it runs perfectly on other servers).

Please help. Thank you.

First question I would ask is what version of ASP.NET Ajax do they have installed. Methods have moved to different assemblies over time. v1.0.61025 is the latest.

However, you also do not need to rely on them. You can include the DLL necessary and simply reference that from your project. You don't need to rely on GAC installed assemblies. Check your installation on your system for the System.Web.Extensions.dll and reference it. I think you also should remove the web.config lines that refer to the GAC entry. <add assembly= ......, but I haven't tried that to see if is necessary. If they don't have it installed properly, it may cause an error.


Ok, here's the deal. The hostnig company has the latest AJAX installed on their servers. In fact, I have about 5 websites hosted with this company (all on the same server). AJAX is working on 4 websites - just not working on on one site (for exapmple domain5.com). However, if I was to create a virtual directory pointing to that website it works (for example:www.domain4.com/domain5).

Similarly, I have AJAX working on domain4, but if I have a virtual directory on domain5 pointing to it (such aswww.domain5.com/domain4) then it does not work.

What can be causing this problem? I am thinking there must be a setting blocking AJAX on that domain/website. I noticed that this website has Frontpage Extensions installed. I don't know if that has anything to do with AJAX but I uninstalled it anyways and still doesn't work. Is there anything else - any settings or anything - that I should check that may be causing this problem.

Thanks.


We are having the same issue. Ajax won't work in virtual directories inside of other virtual directories. Have yet to figure out the solution. If anyone has any ideas post them please.

Thanks.


Neither one of you mentioned that you had any errors. However the most common cause of it not working is that the Virtual directory has not been made an Application in IIS. Use IIS to "Create" the application.


Yes, the sub application is set at an application. There are no errors, ajax just doesn't work. It just does full postbacks.

If you take the sub-applcation and remove it from being a "child" app...then it works perfectly. It just doesn't like being nested in another application.


Can application mapping be the cause of this problem. I currently have IIS application maps that cause .html and .xml pages to be run by the .NET framework. Is it possible that this can prevent AJAX from running in any way?


Since I had never tried nested virtual directories, I did a test on localhost using a physical directory created as an application. Inside this I put a virtual directory mapped to its own physical directory (created as an application by default). As another layer, inside this virtual directory, I put a virtual directory mapped to a third physical directory (also created as an application by default). All three function with a variety of Ajax tests including an UpdatePanel. I therefore doubt that common nested virtual directories are the root cause of the problem, unless there is a specific difference in Windows 2003 Server (which I doubt). I'll fire up my server and repeat it if that is suspect.

One thing I had to make sure of with the 2 virtual directories is that the mapped physical directories have to have permission added for the ASPNET user (XP), (or Network Service on server 2003). Otherwise I got a server 500 error after a request for authentication. Since you don't have errors, that is not the problem, but it is another aspect to keep in mind when mapping virtual directories.

However in reviewing the dialog above, there is a bit of confusing information in that two different types of virtual directories are being talked about. A virtual directory that maps to a physical directory on the same server (or even a UNC on another server which involves harder to set up permissions) are the common type. However a virtual directory which maps to a different URL is a re-direction and uses a different sequence of HTTP requests to get to the new directory. Maybe you could clarify how these are mapped if you know (hosting company may hide the implementation)

It is not necessary to have nested virtual directories of the former type for even a complex site. In two large corporations that I have worked at, we didn't have any nesting as there is no need to. You can create as many directory layers as you want before creating the last one as a virtual directory and your web site can have as many virtual directories as you want at the root or lower without any nesting necessary. The level at which an application is created in independent even though it is created by default on a new virtual directory. In a hosted environment it seems to me that the main method for separate domains is different web sites each with it's own applications and physical or virtual directories. So the shared hosting environments must use tricks to point to web sites. The key is getting to the bottom of how this works.

Other than that, if only the UpdatePanel is not working, that seems specific to a DLL loading (or not) and the suggestion that the directory Application is not configured properly is relevant. This should be correctable by deleting the virtual directory and recreating it (being careful to insure permissions for the physical directory are set)

If you want to go further, post the code you used and put it on the suspect web site along with a fresh copy of the template web.config. Send the URL (privately if you want) because I can analyze it with various tools and see what is actually happening when you hit the site.


I think I finally pinpointed this problem. It appears that my site at virtual directory domain1.com/ajaxvirtualdirectory is using the web.config file from the domain1 root directory (although I can't understand why). And when I access it from domain2.com/virtualdirectory it is using the domain2 web.config. Does that make sense?

I know this worked because I temporarily deleted the web.config from domain1 and replaced it with the web.config from domain2. Problem is, I still need the info from the original web.config so what fields do I need to include in the web.config to make AJAX work - or is there anything I can have in there (such as sessionstate=false or anything else). I tried combining the 2 but that didnt work.

Here;s what my web.config looks like

<configuration><!-- application specific settings --><appSettings><add key="ConnectionString" value="server=MYSERVERNAME;database=MYDB;uid=MYUSER;pwd=MYPW;"/><add key="FileDirectory" value="C:\MYFILEDIREC"/></appSettings><!-- forms based authentication --><system.web><compilation debug="true"><compilers><compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True /imports:Microsoft.VisualBasic,System"/></compilers></compilation><!-- enable Forms authentication --><authentication mode="Forms"><forms name="MYFORMAUTH" loginUrl="login.aspx" protection="All" path="/"/></authentication><!-- enable custom errors for the application. Change mode to off to see what error is. RemoteOnly to hide errors --><customErrors mode="Off" defaultRedirect="Errors.aspx" /><!-- disable session state for application --><sessionState mode=""/><globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/><xhtmlConformance mode="Legacy"/><pages><namespaces><add namespace="Microsoft.VisualBasic"/></namespaces></pages></system.web><!-- set secure paths --><location path="PAGE1.aspx"><system.web><authorization><deny users="?"/></authorization></system.web></location><location path="PAGE2.aspx"><system.web><authorization><deny users="?"/></authorization></system.web></location><location path="PAGE3.aspx"><system.web><authorization><deny users="?"/></authorization></system.web></location></configuration>