Showing posts with label iis. Show all posts
Showing posts with label iis. Show all posts

Wednesday, March 28, 2012

Very long loading times on II7 free hosting sites

I've deployed a recently started project on 2 IIS 7 free hosting companies, hostmysite.com and maximumasp.com.

I have encountered big loading times on the whole site, but mostly at AJAX parts. For example I have a few cascade drop down lists and it takes 2-3 seconds to populate 1 dropdown with 3-4 listitems when the user selects something in the first dropdown. On my localhost it happends faster than you blink (E6660, 2 GB RAM).

Have anyone tried out this services ? Its their fault for the big loading times or maybe it's something from my code ? I'm really worried about this and I have no other testing option except this free hosts.?

Well, how does it run for you in development?

You really need to look at what's slow. Is it your app or is the Internet Connection? Is it latency (ie. startup of the app) or is it request times that are slow.

Hosting sites often have issues with very short Application Pool timeouts that cause the entire app to shut down and are then slow to restart. However, this should not be an issue if you use the site for a number of hits in a row.

+++ Rick --


I'd recommend you first use something like FireBug (or the IE equivalent) to monitor the network traffic your partial postbacks cause. It sounds like the network traffic is your bottleneck. Especially watch out for huge ViewStates that get uploaded with every partial postback.


On developing machine it's instant.

I used firebug to do some texts on a page. I have 2 dropdown lists in an update panel and below (outside the update panel) I have a huge gridview. The problem seems to be that gridview's huge viewstate that gets uploaded/downloaded with every partial postback asgt1329asaid.

Now I know the problem. But whats the solution ? Why does the gridview's view state gets uploaded/downloaded everytime even if the gridview is not inside the update panel ?


Unfortunately, the full page's ViewState is sent back and forth on any partial postback. There's no way around that. Though, most of the time there are controls that you can disable ViewState on to minimize it. Or, if you're doing a lot of postbacks, you might consider rebinding controls on the server side, instead of using ViewState to persist them (viability of this really depends on how your page works).

The other option is that you can use web methods/services to replace some of your heavily used UpdatePanels with JSON communication:

http://ajax.asp.net/docs/tutorials/ASPNETAJAXWebServicesTutorials.aspx


Thanks for all the possibilities you recommended me.

Knowing almost nothing about them all I would also like a suggestion about what method to use. I'm trying to make minimize partial postbacks times because 3 seconds for populating a dropdown list with 5 items it not an acceptable time at all.

Using Web Services seems to most suitable method, but as I said, I know almost nothing about them all so I would like to hear an opinion from someone who knows more than me.


You should attempt to do both. Optimize your ViewState and replace partial postbacks with leaner alternatives when it's possible.

Most controls that are based on form elements can have ViewState eliminated. This is beneficial, even in non-AJAX scenarios, but will especially help cut down on the network footprint of your partial postbacks.

Web Method/Services are great. However, you can't (realistically) use them for anything that needs to modify ViewState. I'd say they're especially well suited to read-only operations that display changing data. A stock ticker, for example. On the other hand, manipulating a GridView with Web Methods would be tough. For more info on web methods vs. UpdatePanels, take a look at this:http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

Also, don't forget the AjaxToolkit. For your dropdown, you could use the cascading dropdown extender in the toolkit to do half the work for you (just need to make the web service for it and you're done).


Allright I've used cascadeDropDown extender for my 2 dropdowns and wrote a WS to handle them. The problem is now that depending of the selection I make in the first dropdown I also want to display or hide a label or change it's Text value. This cannot be done within the WS so I'm back to where I started.


I believe those dropdown extenders fire the normal client side events. So, you could handle EndRequest() to change cosmetics like a text label or div visibility on the client side (or do it on BeginRequest, if you wanted).

Basically, if it's a read-only, cosmetic change, try to do it in client script if you can.


If you are looking for super lightweight grid which support binding data from a web service call try thishttp://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx


Could you please detail this gt1329a ?

Saturday, March 24, 2012

Warnings at web server side

Hello,

Log of IIS 5.0 under Win 2000 Server contains the following warnings relating to PreRender of the AJAX ScriptManager:

"Exception information:
Exception type: InvalidOperationException
Exception message: Partial rendering requires a browser that supports W3C DOM Level 1.0.

Thread information:
Thread ID: 11
Thread account name: WEBSERVERA\ASPNET
Is impersonating: False
Stack trace: at Microsoft.Web.UI.ScriptManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
"

Do you have an idea what the users see in their browsers in this case? Or please give me a hint which browser I should use to test this (I think it should be a really old one)

Regards,

Di.

Hi Di,

You are right about the browser being old. For AJAX to work the browser should support XMLHttp Object.

On your pages you can run a client script which would check for this object and display a browser compatibility issue than waiting for the page to be sent to the server.

Check this link on how to check for the object in different browsers.

http://www.w3schools.com/dom/dom_http.asp

Happy programming,
Anton


Hi Anton,

Thanks for the info.

But I still want to find out what users see in their browser in the case of such warnings. How does it affect their work with the web site...

Regards,

D.


I like your enthusiasm. You can download Multiple IE fromhttp://tredosoft.com/

which has simulator from IE 3.0 onwards.

You can also download older version of Netscape fromhttp://browser.netscape.com/ns8/download/archive.jsp

but they dont have all versions but start from 4.7 onwards

Happy programming,

Anton


Thanks. Will check 'em.

WCF Hosted in IIS over SSL

I've got a Windows Communication Foundation service that I'm hosting in IIS 6 and running over SSL using a certificate that I created using selfssl. I'm able to view the .svc with no errors in IE but when I tried to add a service reference to it in Visual Studio I got the following error:

Error: Cannot obtain Metadata from https://localhost:777/AuthService.svc

If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.

WS-Metadata Exchange Error

URI: https://localhost:777/AuthService.svc

Metadata contains a reference that cannot be resolved: 'https://localhost:777/AuthService.svc'.

Could not establish trust relationship for the SSL/TLS secure channel with authority 'localhost:777'.

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

The remote certificate is invalid according to the validation procedure.

HTTP GET Error

URI: https://localhost:777/AuthService.svc

There was an error downloading 'https://localhost:777/AuthService.svc'.

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

The remote certificate is invalid according to the validation procedure.

I checked the article it referenced in the error message and I can't find anything I've got setup wrong. Thanks in advance for any help. Here's my config file:

<

system.serviceModel>

<

bindings>

<

wsHttpBinding>

<

bindingname="sslTest">

<

securitymode="Transport">

<

transportclientCredentialType="None"/>

</

security>

</

binding>

</

wsHttpBinding>

</

bindings>

<

services>

<

servicename="HEI.Auth.BL.AuthUtil"behaviorConfiguration="myServiceBehavior">

<

endpointaddress=""binding="wsHttpBinding"bindingConfiguration="sslTest"contract="HEI.Auth.BL.Interfaces.IAuthenticate" />

<

endpointcontract="IMetadataExchange"binding="mexHttpsBinding"address="mex"/>

<

host>

<

baseAddresses>

<

addbaseAddress="https://localhost:777/AuthService"/>

</

baseAddresses>

</

host>

</

service>

</

services>

<

behaviors>

<

serviceBehaviors>

<

behaviorname="myServiceBehavior">

<

serviceMetadatahttpsGetEnabled="true"httpsGetUrl=""/>

</

behavior>

</

serviceBehaviors>

</

behaviors>

</

system.serviceModel>Sorry if I missed something, but this doesn't appear to be related to ASP.NET AJAX. You might get better help on a WCF forum.
The reason I posted it here is because I did a search for wcf and this was about the only forum that had any posts for wcf. Anyway, it was a problem with my certificate. I created a certificate with selfssl but I didn't name it "localhost" so the certificate didn't match the site address. Once I made a new certificate with cn=localhost I was able to add the service reference in visual studio.