Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Wednesday, March 28, 2012

How do I UnitTest My Atlas component

Hi,

Can anyone guide me how I can unit test my atlas component. Here is the scenario
I have existing app which is using javascript ...now i was thinking about removing it
and implement atlas functionality. However this gives me opportunity to write test
cases. Can someone tell me if MSTS has inbuilt functionality for this or which other
way i can test my component built in atlas. Will Nunitasp or Nunit work?

Thank you

VSTS does not have built-in support for JavaScript. Neither does NUnit. You might be able to use NUnitAsp, but I would recommend JsUnit:http://www.edwardh.com/jsunit/

-Mike

Monday, March 26, 2012

How do I deploy an AJAX Toolkit web app?

This seems like a pretty common thing to want to do, yet I can't find anything (clear) in the documentation or various forums. Simply put, how do I deploy an AJAX enabled ASP.NET 2.0 application?

I can get the files on the server no problem, but what do I need to install on the server to get the AJAX 1.0 code to work? I assume I just need to install AJAX 1.0 on the server, and everything should be fine, right? If so, then why isn't my AJAX code working. If not, then what am I missing?

Note, I'm using the CascadingDropDown control. It works fine on my development computer, but I get the following message when trying to run it on our web server:

AjaxControlToolkit.CascadingDropDown missing required Category property value for CascadingDropDown1.
Parameter name: Category

The category parameter is being set, so I don't understand what the error is.

Any help is much appreciated.

Hi...

and welcome to ASP.NET Forums!

I have an article on cascading dropdownlist. Check this linkhttp://www.aspalliance.com/1183

You also need to make sure, the parameter names should be the same (case-sensitive) as defined in the docs.

Thanks

How do I change the form id that scriptmanager is referencing?

here's a little more detail...

The app is hosted in a portal environment. The portal appends a "token" number to each form on the page to ensure unique form names (the portal page could have more than one form). For example, if I have <form id="form1"> it will change it to something like <form id="form1_1458">. A javascript error occurs after the page loads saying "'this._form' is null or not an object."

I did a viewsource of the page and I see the following:

 <script type="text/javascript">//<![CDATA[Sys.WebForms.PageRequestManager._initialize('form1_1458', document.getElementById('form1'));Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);//]]></script>

I'm not sure if this is the issue but the scriptmanager is referencing to form1.

What I want to do is force the scriptmanager to get document.getElementById('form1_1458'). How can I accomplish this?

the cz of the problem not tht u have a form name inconveniance its about an html error u can run ur page under firefox successfully

u can fix ur prob by checking the syntax b4 the form tag the body tag or another tag check for html syntax errors like added " or unclosed tags

hope being usefull......


I'm surprised this hasn't caused you issues before. If you think about it the server ID is changed which could throw off all control names and references.

I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework. My thought is that you could get access to form1 using something like document.forms[0] which will get the first form (without using the ID)

-Damien


where/how do I tell the scriptmanager to use document.forms[0]?


Not sure... from my last post: "I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework..."

The form reference gets set by the ASP.NET AJAX Framework's client scripts; you don't specify the form. Seehttp://www.asp.net/ajax/documentation/live/overview/ScriptManagerOverview.aspx for more info on the ScriptManager

-Damien


finally figured this one out. Many thanks to http://aspnetresources.com/articles/HttpFilters.aspx