{"id":14,"date":"2007-02-12T20:09:47","date_gmt":"2007-02-12T09:09:47","guid":{"rendered":"http:\/\/thekua.com\/atwork\/?p=14"},"modified":"2019-07-18T15:59:08","modified_gmt":"2019-07-18T13:59:08","slug":"getting-nunit-asp-to-work-with-net-20","status":"publish","type":"post","link":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/","title":{"rendered":"Getting NUnit ASP to work with .Net 2.0"},"content":{"rendered":"<p>On my current project we\u00e2\u20ac\u2122ve been having a pretty good experience leveraging the <a href=\"http:\/\/nunitasp.sourceforge.net\">NUnitASP library<\/a> for automated testing of our website. In our second week of development, we noticed like many other people, that it is yet fully compatible with .Net 2.0 because of the way that ASP.Net now generates its javascript postback functions. <\/p>\n<p>In the previous .Net version, ASP.Net seemed to generate a very simple function of the form of <code>__doPostBack([targetId], [targetArguments]) <\/code> that would effectively set two hidden variables (<code>__EVENTTARGET<\/code> and <code>__EVENTARGUMENT<\/code> respectively). In the current version, ASP.Net generates a much more complex javascript function (called <code>WebForm_DoPostBackWithOptions<\/code>) that I think is caused with use of any of the ASP validator components. <\/p>\n<p>One work around that one person (Lance Ahlberg) found was to turn the \u00e2\u20ac\u0153<code>CausesValidation<\/code>\u00e2\u20ac\u009d property off for controls but this may or may not suit the way that you are developing your website. Looking at what the javascript generated does, I think that there must have been a better solution so I spent some time delving into the depths of NUnit ASP to find one. <\/p>\n<p>The result is a patch to <code>ControlTester.cs<\/code> that allows the <code>__EVENTTARGET<\/code> and <code>__EVENTARGUMENT<\/code> to still be set by extracting out the appropriate values from the new <code>WebForm_DoPostBackWithOptions<\/code> javascript function. You can download the patch <a href=\"http:\/\/thekua.com\/atwork\/wp-content\/uploads\/2007\/02\/ControlTester.patch\">here<\/a> but you have to build your own NUnit ASP, or wait until this is integrated with the next release. The ticket for my submission can be found <a href=\"http:\/\/sourceforge.net\/tracker\/index.php?func=detail&#038;aid=1657809&#038;group_id=49940&#038;atid=458032\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On my current project we\u00e2\u20ac\u2122ve been having a pretty good experience leveraging the NUnitASP library for automated testing of our website. In our second week of development, we noticed like many other people, that it is yet fully compatible with .Net 2.0 because of the way that ASP.Net now generates its javascript postback functions. In [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10,4,12,11],"tags":[67,69,64,71,70],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-net","category-asp","category-development","category-testing","category-web-development","tag-net","tag-asp","tag-development","tag-testing","tag-web-development","post-preview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting NUnit ASP to work with .Net 2.0 - patkua@work<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting NUnit ASP to work with .Net 2.0 - patkua@work\" \/>\n<meta property=\"og:description\" content=\"On my current project we\u00e2\u20ac\u2122ve been having a pretty good experience leveraging the NUnitASP library for automated testing of our website. In our second week of development, we noticed like many other people, that it is yet fully compatible with .Net 2.0 because of the way that ASP.Net now generates its javascript postback functions. In [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/\" \/>\n<meta property=\"og:site_name\" content=\"patkua@work\" \/>\n<meta property=\"article:published_time\" content=\"2007-02-12T09:09:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-18T13:59:08+00:00\" \/>\n<meta name=\"author\" content=\"Patrick\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@patkua\" \/>\n<meta name=\"twitter:site\" content=\"@patkua\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Patrick\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/\"},\"author\":{\"name\":\"Patrick\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"headline\":\"Getting NUnit ASP to work with .Net 2.0\",\"datePublished\":\"2007-02-12T09:09:47+00:00\",\"dateModified\":\"2019-07-18T13:59:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/\"},\"wordCount\":240,\"commentCount\":3,\"keywords\":[\".Net\",\"ASP\",\"Development\",\"Testing\",\"Web Development\"],\"articleSection\":[\".Net\",\"ASP\",\"Development\",\"Testing\",\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/\",\"name\":\"Getting NUnit ASP to work with .Net 2.0 - patkua@work\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\"},\"datePublished\":\"2007-02-12T09:09:47+00:00\",\"dateModified\":\"2019-07-18T13:59:08+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2007\\\/02\\\/getting-nunit-asp-to-work-with-net-20\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting NUnit ASP to work with .Net 2.0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\",\"name\":\"patkua@work\",\"description\":\"The intersection of technology and leadership\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\",\"name\":\"Patrick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"caption\":\"Patrick\"},\"sameAs\":[\"http:\\\/\\\/thekua.com\\\/atwork\"],\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/author\\\/patrick\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting NUnit ASP to work with .Net 2.0 - patkua@work","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/","og_locale":"en_US","og_type":"article","og_title":"Getting NUnit ASP to work with .Net 2.0 - patkua@work","og_description":"On my current project we\u00e2\u20ac\u2122ve been having a pretty good experience leveraging the NUnitASP library for automated testing of our website. In our second week of development, we noticed like many other people, that it is yet fully compatible with .Net 2.0 because of the way that ASP.Net now generates its javascript postback functions. In [&hellip;]","og_url":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/","og_site_name":"patkua@work","article_published_time":"2007-02-12T09:09:47+00:00","article_modified_time":"2019-07-18T13:59:08+00:00","author":"Patrick","twitter_card":"summary_large_image","twitter_creator":"@patkua","twitter_site":"@patkua","twitter_misc":{"Written by":"Patrick","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/#article","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/"},"author":{"name":"Patrick","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"headline":"Getting NUnit ASP to work with .Net 2.0","datePublished":"2007-02-12T09:09:47+00:00","dateModified":"2019-07-18T13:59:08+00:00","mainEntityOfPage":{"@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/"},"wordCount":240,"commentCount":3,"keywords":[".Net","ASP","Development","Testing","Web Development"],"articleSection":[".Net","ASP","Development","Testing","Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/","url":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/","name":"Getting NUnit ASP to work with .Net 2.0 - patkua@work","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/#website"},"datePublished":"2007-02-12T09:09:47+00:00","dateModified":"2019-07-18T13:59:08+00:00","author":{"@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"breadcrumb":{"@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thekua.com\/atwork\/2007\/02\/getting-nunit-asp-to-work-with-net-20\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekua.com\/atwork\/"},{"@type":"ListItem","position":2,"name":"Getting NUnit ASP to work with .Net 2.0"}]},{"@type":"WebSite","@id":"https:\/\/thekua.com\/atwork\/#website","url":"https:\/\/thekua.com\/atwork\/","name":"patkua@work","description":"The intersection of technology and leadership","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekua.com\/atwork\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae","name":"Patrick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","caption":"Patrick"},"sameAs":["http:\/\/thekua.com\/atwork"],"url":"https:\/\/thekua.com\/atwork\/author\/patrick\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":1,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":3310,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/14\/revisions\/3310"}],"wp:attachment":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}