How to Test an AJAX Installation - asp.net

Is there a simple and foolproof way we can test an AJAX installation? We have a problem in calling a webscript using AJAX form a JS file. The error is 'ServiceLib' is not defined. The error gets a few hits on Google.
We've added some AJAX functionality to a customer's app. This works fine here in the office on dev machines and on our IIS Server, it works fine on the customer's test web site, but when we put the app on the live site, the webscript calls fail.
The customer installed AJAX on their live server a few days ago. We've verified that the service lib files are there and in the right places.
We've already spent hours on this with no solution and still do not know for sure whether there is something wrong with our code, or something is wrong on their server, or for that matter, whether AJAX is even correctly installed. Part of our problem is that we have no access to their live server, so there is not much we can do other than change lines in our own code, give the app files to our contact there, and see what happens. The contact knows less than we do, so we are working blind. A strange situation, I know, but there is beaurocracy involved.
Many thanks
Mike Thomas

Firebug might help - if you can get someone at the far end to install it, it may be able to give you an insight into what is going on with the ajax requests via its console, which logs and gives you the ability to view the return data of all ajax requests.

I'm thinking...
There are three parts to the process:
1) The client-side javascript logic in the browser sends the HTTP request to the server.
2) The server-side ASP.NET page processes it and responds.
3) The client-side logic receives the response and updates the web page, or whatever.
Swap out each part with something simpler and diagnostic to see where in the pipeline the break is.
For example, create a diagnostic webpage that's a substitue for #1 that calls the server-side page directly.
If that seems to work, create a different server-side ASP.NET page that's very simple, just logs something, to prove that the real #1 does what your diagnostic #1 did.
Ya know, your standard debugging binary search...

Related

Jmeter Performance test on ASP.net form losing session

Hi guys i have a very strange problem. I am tasked to conduct several performance tests on an old Webpage (2004 - something).
The module that is under test is created with ASP.net forms.
Im using Jmeter for the task.
I have used Chrome extention (Blazemeter) to generate the starting script.
But a very strange problem occurs all other pages of the form are fine and dandy... except a page for file upload where upon trying to proceed(Make a POST request) it loses its session and you are redirected to another screen with generic- Would you like to continue last session type of messages appear.
In order to try to debug the problem i wrote a simple Post request on IntelliJ and everything works fine when executed.
I then returned to Jmeter and punched in everything identical to the script and i still get the same problem.
I then decided to try the Jmeter recording proxy ( in case the blazemeter is faulty and assigns some values incorectly) And while i was manualy browsing the form the problem Appears! - when i click on proceed on that specific upload form with the jmeter proxy turned on, it loses session and it shows the "continue last session screen". And i am baffled as to how a simple proxy that records could mess up the sessions. I tried it with a normal proxy (not the Jmeter one) and everything works. So it seems that the problem is in Jmeter or some settings.
Have you guys ever encountered such a problem , or have some insight as to what might cause such behavior. Additional info:
I have worked on ASP.net form before and i am extracting __VIEWSTATE __EVENTARGUMENT and a couple of other hidden variables from the previous response and passing them to the request.
I am using the Multipart/form-data for the upload file module POST and passing the file properly.
As a standart i am using KeepAlive and Follow Redirects but i have tried Redirect Automatically or all of the above switched off.
There is a Cookie Manager set up on Test Plan level and it is working in HC4 - compatibility(tried all others too) based on the requests its working properly.
Cache Manager to 5000 elements.
Certificates seem to be properly imported (for the Jmeter proxy).
I am at this point baffled as to why Jmeter refuses to act properly and i would be very gratefull if someone could help me.
Hi guys il just post an update since i found a work around. So if i record everything with blazemeter (since jmeter proxy doesnt allow me) and after on the upload step i delete the steps and just write a manual request in the body with multipart/form tick turned off and just write the multipart stuff in the headers it seems to work. I still have no idea why it behaves this way.

What exact settings required in iis for asp.net pages to process it faster?

I am having a simple blank page without any source code.The page also taking very long time to come.I am not able to understand the reason behind this.
The domain is getting a high requests.
What exact settings needs to be done in iis 7.0 so that it will be faster.
Please help.
ASP.NET pages always have an initial delay when the first request is made after the file has been created/edited/uploaded because the server needs to recompile them, however it shouldn't be more than 2-3 seconds in practice, and does not affect subsequent pageloads.
The only thing I can think of is an overloaded server. Assuming you're on a shared hosting package then I recommend you find another ISP. If not, then I'm afraid there's a lot more to it than just a "page pages load faster" switch hidden away.

ADFS (CRM 2011) - Authentication Issue in Microsoft Outlook Client for CRM (Response.Redirect(...) & Window.Open(...))

Before I start, our customers have to connect through AFDS to be able to go on the CRM 2011. So we are talking about an “IFD”-environment.
I’m having a problem when using the “CRM 2011 Outlook Client” and the “Window.Open(…)”-JS function. When they hit a button in the CRM 2011 an ASPX-page fires up and does some stuff with an attachment in the e-mail. It then creates successfully a contact and then afterwards it should redirect to that “Contact”-page. But each time I do a redirect to a “CRM 2011”-page, the user is prompt for his credentials. That’s because the “Window.Open(…)” opens the screen in an new “Browser”-screen and the authentication is lost (because we come from the outlook client).
The above scenario works fine when using the “Web”-based CRM 2011, because you need first to login via ADFS.
Have some of you encountered the above problem and have a great solution to this?
Is there a way to do a “Window.Open(…)” and stay in an “Outlook”-screen? The same as you should double-click a contact in the “CRM 2011 Outlook Client”?
Is there a way while doing a “Redirect”, I can automatically give the credentials to the page, so that it will page will be opened without that the user himself need to enter his credentials? I’ve read something about SignInRequestMessage and FederatedAuthentication, but no clear examples were shown to do this.
I’m hoping that you guys can help me out. At my side, if I find any resolution, I will come back here!
Kind Regards,
Frederic
OK. This is from one of the MS presenters from the ExtremeCRM conference.
The CRM function call is: openObj(entityId, type).
I am a team leads and I had one of my team execute the implementation, but my understanding is that the call would be something like...
openObj('GuidGoesHere', 'account');
One thing to consider is that this will work in your standard client script scenario, however if you require this functionality from within a custom dialog / html resource you may need to add a reference to the appropriate JS reference depending on where in the baseline JS libraries that function resides.
I can dig deeper if you cannot get it working right away. Youd can use various browser dev tools to explore pages and see which JS resources are loaded on the page as well as debug.
Hope this helps!
This issue is related to a cache and performance problem with ADFS and a TMG server. The ability to cache must be turned on both the TMG and inside IIS. Once this issue, also deemed a performance issue went away, users then received the normal popups when performing actions like convert lead to opportunity, or email to case.
Also make sure you are on UR 6..
https://community.dynamics.com/product/crm/crmtechnical/b/cognettacloud/default.aspx

slow of first page, running on windows/IIS

I'm more into the LAMP stack, but I've been asked to work on a site that is running Windows and IIS 2008. I'm a beginner with IIS, so please be patient with me on this, and please ask me to provide more information if that is needed to determine.
I read the answer here (Slow first page load on asp.net site), but it seems like if I go to the site with one browser it takes long to load the first page, then fast on all other pages, then if I open up another browser, it's the same thing, so it's not something that is saved on the server, but per session?
Is there a way to have the application running at all times?
Right now it is taking 12 to 15 seconds for the first page to load.
I have access to the WebControlCenter and FTP.
I would look in the Global.asax page and see if there is anything going on when a session is started. There usually is a method in there called Session_Start that is called whenever a session is started. Also, it might have to do with the site being configured in debug mode. You can change the web.config setting to false, which has a big impact on performance.
I'm familiar with the phenomenon described in the question you've linked to, but your what you're describing does seem a bit odd.
firstly- try Jeff's suggestion and see if indeed there's something at the beginning of the session which slows it down.
If not- try answering this-
1. is the first page always slow or only on first access to it?
2. what happens if you open another tab in the browser (not a different browser)?
3. it's possibel that the page contains some heavy resources (like images, script files etc.) which are only downloaded on the first access to the page. try tracing your http responses you get and see what their sizes are.
4. try to enable trace on your web page to see the events which are taking the longest time (on aspx you need to add 'Page Trace="true"' to the page declaration)
hope one of these helps...
Have you tried a http debugger here? Lots of things could be going on here, but the fact that you get different behavior by using different browsers indicates it is probably some particular resource that is overweight.

need to copy files on client system, is thr any possible way?

I m developin an Online Examination System in C#.net and want to copy files on client machine as soon as exam starts, so that even if internet gets disconnected examinee can continue with test
You may wish to consider a client server solution, such as WPF or winforms as this is more suited to this type of development. You can use one click deployment to have this still launched from the web and updated on every run.
If you do decied to use asp.net this will result in a very javascript heavy site with a very slow load in the first page.
To do this you would load all your test qustions into a javascript datastructure on the first page, when every the user when to the next page you would need to, using javascript, collect all the answers and store in javascript. then rereender the entire page using your definitions of the test in javascript with no trip back to the server. then once the test was complete you would need to send your results back to the server, the internet must be active once you've compleated the test.
You'll have to create a download package and provide a link for the user to click to request the files. You can't force a download.
If your exam in all in one web page, you don't need to do anything. Once the page appears in the users browser, it has already been "copied locally".

Resources