Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts

Wednesday, March 28, 2012

ViewState in Session is still uploaded after AsyncPostBack

Hi all,

Here is the basic setup of my page.

- ViewState stored in session
- AutoCompleteExtender using a WebService
- UpdatePanel triggered by button next to AutoComplete TextBox

Here is the behavior I'm experiencing (note that I have validated this with Fiddler):

Page loads first time. "id="__VIEWSTATE" value="y0V/cubnEZ1qzAvIgW0oRpVSc8AvJU6rtssTVFt7+B8="
ViewState is short as expected because storing it in the session.

Now, I click on the button to activate the UpdatePanel, causing a partial postback. This takes much longer than expected. After inspecting with Fiddler I see that it is uploading 50K. I inspect the Request and notice that most of it is my ViewState (I have a repeater on the page). I even turned EnableViewState off on the Repeater and it still uploads it.

My questions are:

1. Where is this uploaded ViewState coming from? It was not downloaded, is it generated clientside by JavaScript?
2. How can I stop this ViewState from being uploaded?

Regards,
Cole

I now realize this is not the viewstate but all of the form elements names & values being concatenated together. Is there a way to adjust what gets sent back from the controls on a AsyncPostBack?


The only way I'm aware of is to not use updatepanels to traffic your info, but instead to use web services, page methods, or hand-jam your own webrequest.

Monday, March 26, 2012

VS 2005 IDE now unstable and crashing

I recently installed AJAX and the control toolkit, setup a sample website and it worked very slick. I have an existing app written in VB.net in VS 2005 that i am integrating the AJAX toolkit, specifically the dropdownshadow extender, scriptmanager and updatepanel, having copied the needed configuration into my web.config from the small app i wrote.

The problem is my environment is now extremenly unstable and crashes whenever i try to change a property of a control within the update panel or on any page containing an ajax control. Simply clicking on a textbox within the AJAX control will randomly cause an error screen i have never seen before saying Visual Studio has encountered an error and must restart.

Once the crash happens i cannot switch to design view as it says no AJAX tags are recognized, yet if i compile and run it works fine, not much help if i cannot design tho. I strip the tags out in code view and i am off again until the next crash.

After some crashes i try to drag an AJAX control onto a page and i get an 'Error: control could not be created' , control is not recognized. I have to reboot my system to get it to work.

I installed SP1 Beta and the problem still persists. This is very frustrating as the controls are working great other than when they crash my IDE. I will attach a screenshot if needed once i get in front of my dev station.

Hopefully someone has had this problem already.

Cheers!! And great work so far!!

I have never seen that, but can be a bug fixed in the new SP1 for VS2005http://alpascual.com/blog/al/archive/2006/12/15/Visual-Studio-2005-Service-Pack-1-has-been-released.aspx

See if installing it fixes your problems


This happens to me much more often as well after installing AJAX.

Sorry been away for a while, i installed SP1 but still unstable. I also constantly get

Error 182 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site.

It does not occur everytime but when it does i cannot change to design view. The site still runs fine but it is frustrating that i have to reboot or wait for the 'magic' in the air to sort the problem out. I have seen this in many forums but no one ever has an answer yet.


VS2005 often crashes when I try to shut it down with SP1 and SP1 for Vista. I get memory corrupt errors and it can't recognize the ASP.NET Ajax tags most of the time. I am running Vista x64 RC1 though so some problems could be related to that...

Saturday, March 24, 2012

WCF and ASP.NET 3.5 RTM integration on different sites - 404 errors

Hello,

Setup 1:

Project with WCF service in it .svc file has Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory", web.config does not include <system.ServiceModel> junk. We've got your standard config-free json service that has been hyped. VS 2008 web dev server url (simplicity sake here):http://localhost:1/service.svc

Seperate Project with ASP.NET application in it. ScriptManager has a service reference to the above svc file at (http://localhost:1/service.svc). Javascript on the page invokes a method in the service. VS 2008 web dev server url (simplicity again):http://localhost:2/webform.aspx

Runtime 1:

    JS "proxy class" is successfully downloaded from the service (http://localhost:1/service.svc/jsdebug)

    JS Object contructed from the proxy class.

    Error on invocation of service method - 404 not found!

    Fiddler says proxy class is invoking the service athttp://localhost:2/service.svc/myServiceMethod. Please note the port there, it should behttp://localhost:1 not 2! 2 is the site where the webform is being hosted at.

Config 2:

Move the WCF project onto local IIS 7.0 (Vista).

Update script reference to the service tohttp://[machinename]/serviceVD/service.svc

Runtime 2:

    JS "proxy class" is successfully downloaded from the service (http://[machinename]/serviceVD/service.svc/jsdebug)

    JS Object contructed from the proxy class.

    Error on invocation of service method - 404 not found!

    Upon inspection the proxy class is invoking the service athttp://localhost:2/serviceVD/service.svc/myServiceMethod. Please note the port there, it should behttp://[machinename]/serviceVD nothttp://localhost:2! Again the root of the url is being pulled from where the webform is being hosted.

All the references I've seen and have gotten to work include the WCF service in the same project as the webform that is calling them. How do I call remote service on another site or machine?

Not sure if it will help but it hass some good info of Asp.net Ajax with WCF by Dino Esposite
http://dotnetslackers.com/articles/ajax/JSON-EnabledWCFServicesInASPNET35.aspx