tag:blogger.com,1999:blog-77329489242677009612024-03-09T00:34:40.410+05:30Spyder's WebIn search of inner peaceSpyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-7732948924267700961.post-29722748455989792942010-07-16T22:22:00.000+05:302010-07-16T22:22:50.828+05:30Which email clients support CSS3? - Blog - Campaign Monitor<div>I would not recommend using CSS3 for emails as only one feature was found compatible across email clients which does not even list lotus notes.</div><div><br /></div><a href="http://www.campaignmonitor.com/blog/post/3107/css3-support-in-email-clients/">Which email clients support CSS3? - Blog - Campaign Monitor</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-37584242380493111592009-12-15T18:55:00.000+05:302009-12-15T18:55:36.838+05:30jQuery and Microsoft - ScottGu's Blog<a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">jQuery and Microsoft - ScottGu's Blog</a>: "The jQuery intellis"Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-327859869211817972009-12-15T16:24:00.000+05:302009-12-15T16:24:21.427+05:30Google Code Blog: Google Fusion Tables API<a href="http://googlecode.blogspot.com/2009/12/google-fusion-tables-api.html">Google Code Blog: Google Fusion Tables API</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-67853482649371211302009-12-15T14:51:00.000+05:302009-12-15T14:51:03.433+05:30Top 8 browser versions from Dec 8 to 14 2009<a href="http://gs.statcounter.com/#browser_version-ww-daily-20091208-20091214-bar">http://gs.statcounter.com/#browser_version-ww-daily-20091208-20091214-bar</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-52077888727239480332009-12-11T17:49:00.000+05:302009-12-11T17:49:15.435+05:30Custom Events, and the Special Events API in jQuery - Nettuts<a href="http://net.tutsplus.com/tutorials/javascript-ajax/custom-events-and-special-events-api-in-jquery/">Custom Events, and the Special Events API in jQuery - Nettuts</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-19311209150709562342009-12-11T11:05:00.000+05:302009-12-11T11:05:02.921+05:30The #1 Javascript Pop Up - Get TopUp! - Home<a href="http://digg.com/d31AhTJ">The #1 Javascript Pop Up - Get TopUp! - Home</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-14063791330425130492009-12-11T10:46:00.000+05:302009-12-11T10:46:25.624+05:30A Beginner's Guide To jQuery<a href="http://digg.com/d3rBqx">A Beginner's Guide To jQuery</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-33407934388791418062009-12-10T09:18:00.000+05:302009-12-10T09:18:37.988+05:30ReSharper:: The Most Intelligent Add-In To Visual Studio 2008 - C# 3.0, LINQ, VB.NET, ASP.NET, XML, XAML, build scripts. Best-of-breed tools for code analysis, code cleanup, code generation, and unit testing, plus multiple refactorings and code templates.<a href="http://www.jetbrains.com/resharper/">ReSharper:: The Most Intelligent Add-In To Visual Studio 2008 - C# 3.0, LINQ, VB.NET, ASP.NET, XML, XAML,<br /> build scripts. Best-of-breed tools for code analysis, code cleanup, code generation, and unit testing, plus<br /> multiple refactorings and code templates.</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-65962427636367740552009-12-10T09:17:00.000+05:302009-12-10T09:17:51.854+05:30Resharper is amazing, take N<a href="http://ayende.com/Blog/archive/2009/12/06/resharper-is-amazing-take-n.aspx">Resharper is amazing, take N</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-2917361925071621922009-12-10T09:15:00.000+05:302009-12-10T09:15:26.886+05:30Image Editor Jetpack<a href="http://digg.com/d31CNpw">Image Editor Jetpack</a><div><br /></div><div><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(69, 51, 32); line-height: 20px; ">A Firefox extension which allows you to edit any image on the web. After you installed the extension, right click on the image in Firefox and select Edit Image to activate Jetpack Image Editor. The interface and features are very similar to Photoshop. There are: Tool bar, Layers, History, Adjustment, Filter, and more. Technically speaking, it is like a mini version of Photoshop that runs in Firefox.</span></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-73115142801829739832009-12-10T09:13:00.000+05:302009-12-10T09:13:24.372+05:30Adobe® BrowserLab<a href="http://digg.com/d31ATvf">Adobe® BrowserLab</a><div><br /></div><div><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', Times, serif; color: rgb(69, 51, 32); line-height: 20px; "><a href="https://browserlab.adobe.com/" style="color: rgb(0, 0, 0); text-decoration: underline; outline-style: none; outline-width: initial; outline-color: initial; ">Adobe BrowserLab</a> is an online tool that allows you to view how different browsers (in different operating systems) renders your web pages. Just enter your web page URL, press Enter, and it will create a screen capture of the web page in the browsers you selected.</span></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-39649458011602145412009-12-10T09:07:00.000+05:302009-12-10T09:07:20.533+05:30Google Docs Adds Batch Export Features - Webmonkey<a href="http://digg.com/tech_news/Google_Docs_Adds_Batch_Export_Features_Webmonkey">Google Docs Adds Batch Export Features - Webmonkey</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-69762703100424894372009-12-10T09:03:00.000+05:302009-12-10T09:03:03.156+05:30Comparing earth with other celestial bodies<a href="http://digg.com/d31CNma">Comparing earth with other celestial bodies</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-54807171689908271642009-12-10T08:56:00.000+05:302009-12-10T08:56:25.869+05:30Facebook Connect Is Getting Huge<a href="http://www.businessinsider.com/facebook-connect-is-getting-huge-2009-12?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+typepad%2Falleyinsider%2Fsilicon_alley_insider+%28Silicon+Alley+Insider%29&utm_content=Twitter">Facebook Connect Is Getting Huge</a><div><br /></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(34, 34, 34); line-height: 20px; ">Facebook Connect announced today it has 60 million users on 80,000 sites.</span></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-35940588467726432882009-12-09T17:14:00.000+05:302009-12-09T17:14:21.568+05:30Managing UI Complexity | Brandon Walkin<a href="http://digg.com/programming/Managing_UI_Complexity_Brandon_Walkin">Managing UI Complexity | Brandon Walkin</a>: <div><br /></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(57, 55, 51); line-height: 21px; ">Interface complexity is an issue every designer wrestles with when designing a reasonably sophisticated application. A complex interface can reduce user effectiveness, increase the learning curve of the application, and cause users to feel intimidated and overwhelmed.</span></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-38273338257501961192009-12-09T17:06:00.001+05:302009-12-09T17:10:08.502+05:304 things you should track on your blog or website<a href="http://digg.com/d31CIyv?t">4 things you should track on your blog or website</a><br />
<div><br />
</div><div><span style="font-family: helvetica, arial, verdana, sans-serif; font-size: 14px; line-height: 21px;">If you are serious about your website or blog, you should definitly take the analytics part seriously. In this post I explain how to track some events on your pages to help you improve the website. These examples are targetting mostly Wordpress and Google Analytics users, but most analytics tools should be able to perform these actions (if they don’t you should think about changing).</span><br />
</div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-78442621937318160742009-12-09T15:30:00.001+05:302009-12-09T15:30:42.377+05:30Google Chrome Extensions<div><span class="Apple-style-span" style=" ;font-family:Arial, sans-serif;font-size:13px;">Add features to Google Chrome by installing extensions:</span></div><a href="https://chrome.google.com/extensions">Google Chrome Extensions</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-84826605137904564062009-12-09T15:30:00.000+05:302009-12-09T15:30:24.406+05:30Google Chrome Extensions<div><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 13px; ">Add features to Google Chrome by installing extensions:</span></div><a href="https://chrome.google.com/extensions">Google Chrome Extensions</a>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-14710593813894074102009-04-13T18:08:00.002+05:302009-04-13T18:23:47.571+05:30Calendar Extender and TextBox set to ReadOnly in C#If you are using calendar extendar along with a textbox to get the calendar's date then one of the things that you may want to try is to restrict the user from entering into the text box directly. One simple way to do that is to set readonly property to true. However, when you do that, the value does not become available in the code-behind of the page. One of the solutions is given below,<div><br /></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; ">Put onKeyPress = "javascript: return false;" onPaste = "javascript: return false;" in your textbox. That way, even the textbox is enabled, the user will not be able to modify the data.</span><br /></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;"><br /></span></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;">To find more about other solutions and issues faced by other users, you can read the thread below:</span></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;"><br /></span></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;"><a href="http://forums.asp.net/p/1117573/3083903.aspx#3083903">http://forums.asp.net/p/1117573/3083903.aspx#3083903</a><br /></span></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com2tag:blogger.com,1999:blog-7732948924267700961.post-3731209723066616042009-04-13T14:25:00.002+05:302009-04-13T14:36:01.693+05:30Comparison of Political Debate in America and IndiaIn a few days from now, one of the largest democracies in the world is going to elect its leaders. Sad to say, that despite many political parties in India trying to ape the west by using electronic media, the content of debate and commitment remain far from satisfactory.<div><br /></div><div>While CNN and YouTube came together to provide a great platform to start a question / answer round as well as organize meaningful debates on which party / candidate would do what for the country if elected; our own media continues in sensationalizing trivial matters and is unable to create the right focus despite having such tremendous capability.</div><div><br /></div><div>Our politicians are no better. They are relying on spreading hatred among the people of India and instead of discussing how they will take India to the next step their focus remains on settling personal scores.</div><div><br /></div><div>I am afraid, at this rate the verdict will remain as fractured as it was in the last two General Elections. </div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-35732939124095675152009-04-02T16:47:00.002+05:302009-04-02T16:54:58.231+05:30How to implement Cascading dropdowns using JQuery, AJAX and ASP.NET<span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family:Arial;font-size:13px;"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">The primary purpose of this article is to showcase how to load dropdowns dynamically from the client side, bring the data from the server using ASP.NET and AJAX. The script will be written using JQUERY.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">For those who want a smaller sample application to go through to get a start on JQUERY / AJAX / ASP.NET combination can read it from (<a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); cursor: text; ">http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse</a>) and if there is a need to post comments or questions you can read it from (<a href="http://kartiksehgal.blogspot.com/2009/04/how-to-submit-form-using-jquery-via.html" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); cursor: text; ">http://kartiksehgal.blogspot.com/2009/04/how-to-submit-form-using-jquery-via.html</a>). Sites.google.com does not facilitate commenting by viewers as yet. As with the previous article, this article too does not require the user to set up any database by creating all the sample data within the code itself.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">Comments or Questions, both are appreciated.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">If there is a need to get into JQuery reference, a good start point will be the site <a href="http://jquery.com/" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); cursor: text; ">http://jquery.com/</a>.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">Source code can be downloaded from <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/contactmanagement_20090402.zip?attredirects=0" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; ">contactmanagement_20090402.zip</a>. This source code contains the above mentioned article’s source code also but is no where interconnected.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">Solution</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailSolutionView.JPG?attredirects=0" imageanchor="1" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailSolutionView.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><b>Steps</b></div><ol style="margin-top: 0in; "><li style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; padding-top: 1px; padding-right: 0px; padding-bottom: 1px; padding-left: 0px; ">Download the zip and set up the application under IIS as an ASP.NET 2.0 virtual directory under the default website</li><li style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; padding-top: 1px; padding-right: 0px; padding-bottom: 1px; padding-left: 0px; ">Open the site in visual studio 2005 and check if you can see all the files as depicted in the solution above</li><li style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; padding-top: 1px; padding-right: 0px; padding-bottom: 1px; padding-left: 0px; ">Open the SendEmailToContact.htm in your browser to run and see the form working</li></ol><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><b><span style=" ;font-size:medium;">Cascading Dropdowns</span></b></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><div style="display: block; text-align: left; "><span style="font-weight: bold; ">The two dropdowns are highlighted below. Notice that a default option "Loading contacts..." is added to the contact dropdown.</span></div><div style="display: block; text-align: left; "><br /></div><div style="display: block; text-align: left; "><span style="font-size:85%;color:#0000ff;"></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size:85%;color:#0000ff;"><</span><span style="font-size:85%;color:#a31515;">tr</span><span style="font-size:85%;color:#0000ff;">></span></p><span style="font-size:85%;"></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size:85%;color:#0000ff;"><</span><span style="font-size:85%;color:#a31515;">td</span><span style="font-size:85%;color:#0000ff;">><</span><span style="font-size:85%;color:#a31515;">select</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">id</span><span style="font-size:85%;color:#0000ff;">="DdlContact"</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">name</span><span style="font-size:85%;color:#0000ff;">="DdlContact"><</span><span style="font-size:85%;color:#a31515;">option</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">value</span><span style="font-size:85%;color:#0000ff;">="loading"></span><span style="font-size:85%;">Loading contacts...</span><span style="font-size:85%;color:#0000ff;"></span><span style="font-size:85%;color:#a31515;">option</span><span style="font-size:85%;color:#0000ff;">></span><span style="font-size:85%;color:#a31515;">select</span><span style="font-size:85%;color:#0000ff;">></span><span style="font-size:85%;color:#a31515;">td</span><span style="font-size:85%;color:#0000ff;">></span></p><span style="font-size:85%;"></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size:85%;color:#0000ff;"><</span><span style="font-size:85%;color:#a31515;">td</span><span style="font-size:85%;color:#0000ff;">><</span><span style="font-size:85%;color:#a31515;">select</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">id</span><span style="font-size:85%;color:#0000ff;">="DdlEmail"</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">name</span><span style="font-size:85%;color:#0000ff;">="DdlEmail"><</span><span style="font-size:85%;color:#a31515;">option</span><span style="font-size:85%;"> </span><span style="font-size:85%;color:#ff0000;">value</span><span style="font-size:85%;color:#0000ff;">="loading"></span><span style="font-size:85%;">Loading contact emails...</span><span style="font-size:85%;color:#0000ff;"></span><span style="font-size:85%;color:#a31515;">option</span><span style="font-size:85%;color:#0000ff;">></span><span style="font-size:85%;color:#a31515;">select</span><span style="font-size:85%;color:#0000ff;">></span><span style="font-size:85%;color:#a31515;">td</span><span style="font-size:85%;color:#0000ff;">></span></p><span style="font-size:85%;color:#0000ff;"></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size:85%;color:#0000ff;"></span><span style="font-size:85%;color:#a31515;">tr</span><span style="font-size:85%;color:#0000ff;">></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="color: rgb(0, 0, 255); "><br /></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; ">Observe the following lines in JQUERY,</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-size:85%;"></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div><span style="font-size:85%;">$.post(</span><span style="font-size:85%;color:#a31515;">"SendEmailToContact.aspx?StrMethodName=GETCONTACTS"</span><span style="font-size:85%;">, {},</span></div><div><span style="font-size:85%;color:#0000ff;"> function</span><span style="font-size:85%;"> (response)</span></div><span style="font-size:85%;"><div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; "> {</div></span><div><span style="font-size:85%;"> $(</span><span style="font-size:85%;color:#a31515;">"#DdlContact"</span><span style="font-size:85%;">).html(response);</span></div><div><span style="font-size:85%;"> $.post(</span><span style="font-size:85%;color:#a31515;">"SendEmailToContact.aspx?StrMethodName=GETCONTACTEMAILS"</span><span style="font-size:85%;">, { DdlContact: $(</span><span style="font-size:85%;color:#a31515;">"#DdlContact"</span><span style="font-size:85%;">).val()},</span></div><div><span style="font-size:85%;color:#0000ff;"> function</span><span style="font-size:85%;"> (response) { $(</span><span style="font-size:85%;color:#a31515;">"#DdlEmail"</span><span style="font-size:85%;">).html(response);});</span></div><span style="font-size:85%;"><div> }<br /> );</div></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><span style="font-size:85%;"><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="border-collapse: separate; color: rgb(85, 85, 68); line-height: 18px; font-family:Verdana;"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span style="font-weight: bold; ">$.post</span> expects 3 arguments</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>a. </span>The name of the page to which the form will be posted</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>b. </span>The arguments which need to be posted</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>c. </span>The function to be called on receiving the response</div></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; ">Here, we have appended a Query String to the SendEmailToContact.aspx which will receive the data requests. </span><span style="color: rgb(163, 21, 21); "><span style="font-weight: bold; ">StrMethodName </span></span><span style="border-collapse: separate; color: rgb(85, 85, 68); line-height: 18px; font-family:Verdana;"><span style="font-weight: bold; ">is checked at the code behind level and if blank, error code -2 is returned. However, in this sample we are not doing any error handling or validation. That will be handled in a subsequent article. </span></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="border-collapse: separate; color: rgb(85, 85, 68); line-height: 18px; font-family:Verdana;"><span style="font-weight: bold; ">"GETCONTACTS" is a specific text that is matched in the code behind and if found, then the relevant method is called to get the data.</span></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="border-collapse: separate; color: rgb(85, 85, 68); line-height: 18px; font-family:Verdana;"><span style="font-size:85%;color:#0000ff;">if</span> (!<span style="font-size:85%;color:#2b91af;">String</span>.IsNullOrEmpty(Request.QueryString[<span style="font-size:85%;color:#a31515;">"StrMethodName"</span>]))</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="border-collapse: separate; color: rgb(85, 85, 68); line-height: 18px; font-family:Verdana;"><div>{</div><div><span> </span>strMethodName = <span style="font-size:85%;color:#2b91af;">Convert</span>.ToString(Request.QueryString[<span style="font-size:85%;color:#a31515;">"StrMethodName"</span>]);</div><div>}</div><div><br /></div><div><span style="font-size:85%;color:#0000ff;"><span style="background-color: rgb(217, 234, 211); ">if</span></span><span style="background-color: rgb(217, 234, 211); "> (strMethodName.Length > 0 && strMethodName.ToUpper().Equals(</span><span style="font-size:85%;color:#a31515;"><span style="background-color: rgb(217, 234, 211); ">"GETCONTACTS"</span></span><span style="background-color: rgb(217, 234, 211); ">))</span></div><span style="background-color: rgb(217, 234, 211); "></span><div><span style="background-color: rgb(217, 234, 211); ">{</span></div><div><span><span style="background-color: rgb(217, 234, 211); "> </span></span><span style="background-color: rgb(217, 234, 211); ">Response.Write(CreateContactDropDownOptions(GetContacts()));</span></div><div><span style="background-color: rgb(217, 234, 211); ">}</span></div><div><span style="font-size:85%;color:#0000ff;">else</span><span style="font-size:85%;color:#0000ff;">if</span> (strMethodName.Length > 0 && strMethodName.ToUpper().Equals(<span style="font-size:85%;color:#a31515;">"GETCONTACTEMAILS"</span>))</div><div>{</div><div><span> </span><span style="font-size:85%;color:#0000ff;">if</span> (i32Contact > <span style="font-size:85%;color:#2b91af;">Int32</span>.MinValue)</div><div><span> </span>{</div><div><span> </span>Response.Write(CreateEmailDropDownOptions(GetEmailsOfContact(i32Contact)));</div><div><span> </span>}</div><div><span> </span><span style="font-size:85%;color:#0000ff;">else</span></div><div><span> </span>{</div><div><span> </span>Response.Write(<span style="font-size:85%;color:#a31515;">"-1"</span>);</div><div><span> </span>}</div><div>}</div><div><span style="font-size:85%;color:#0000ff;">else</span><span style="font-size:85%;color:#0000ff;">if</span> (strMethodName.Length > 0 && strMethodName.ToUpper().Equals(<span style="font-size:85%;color:#a31515;">"SENDEMAIL"</span>))</div><div>{</div><div><span> </span>Response.Write(<span style="font-size:85%;color:#a31515;">"</span><div><span style="font-size:85%;color:#a31515;"></span><p><span style="font-size:85%;color:#a31515;"><strong>To: </strong>"</span> + strEmail + <span style="font-size:85%;color:#a31515;">"</span></p><span style="font-size:85%;color:#a31515;"></span><p><span style="font-size:85%;color:#a31515;"><strong>Subject: </strong>"</span> +</p></div><div><span> </span>strEmailSubject + <span style="font-size:85%;color:#a31515;">"<p></p></span><p><span style="font-size:85%;color:#a31515;">"</span> + strEmailMessage + <span style="font-size:85%;color:#a31515;">"</span></p><span style="font-size:85%;color:#a31515;"></span></div><span style="font-size:85%;color:#a31515;">"</span>);</div><div>}</div><div><span style="font-size:85%;color:#0000ff;">else</span></div><div>{</div><div><span> </span>Response.Write(<span style="font-size:85%;color:#a31515;">"-2"</span>);</div><div>}</div></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; ">Once the data is received from the call, </span><span style="font-weight: bold; ">$(</span><span style="font-size:85%;color:#a31515;"><span style="font-weight: bold; ">"#DdlContact"</span></span><span style="font-weight: bold; ">).html(response); ensures that the response sent from the server is set into the HTML of the select option (replacing any existing HTML. </span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; "><span style="color: rgb(153, 0, 0); ">html()</span> is a JQUERY function to get and set the innerHTML of an element. To keep the scripting simple, we just created option tags in the server itself and sent it to the calling function.</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div><span style="font-size:85%;color:#0000ff;">private </span><span style="font-size:85%;color:#2b91af;">String</span> CreateEmailDropDownOptions(<span style="font-size:85%;color:#2b91af;">List</span><<span style="font-size:85%;color:#2b91af;">ContactEmail</span>> PrmContactEmails)</div><div>{</div><div><span> </span>System.Text.<span style="font-size:85%;color:#2b91af;">StringBuilder</span> strBldOptions = <span style="font-size:85%;color:#0000ff;">new</span> System.Text.<span style="font-size:85%;color:#2b91af;">StringBuilder</span>();</div><div><span> </span><span style="font-size:85%;color:#0000ff;">foreach</span> (<span style="font-size:85%;color:#2b91af;">ContactEmail</span> contactEmail <span style="font-size:85%;color:#0000ff;">in</span> PrmContactEmails)</div><div><span> </span>{</div><div><span> </span>strBldOptions.Append(<span style="font-size:85%;color:#a31515;">"</span> + contactEmail.StrEmail + <span style="font-size:85%;color:#a31515;">"\">"</span> + contactEmail.StrEmail + <span style="font-size:85%;color:#a31515;">""</span>);</div><div><span> </span>}</div><div><span> </span><span style="font-size:85%;color:#0000ff;">return</span> strBldOptions.ToString();</div><div>}</div><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; ">The next step is to take the selected value of the contacts dropdown, which is the first one by default, and make a similar call for the Emails of the selected contact</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div>$.post(<span style="font-size:85%;color:#a31515;">"SendEmailToContact.aspx?StrMethodName=GETCONTACTEMAILS"</span>, { DdlContact: $(<span style="font-size:85%;color:#a31515;">"#DdlContact"</span>).val()},</div><div><span style="font-size:85%;color:#0000ff;"> function</span> (response) { $(<span style="font-size:85%;color:#a31515;">"#DdlEmail"</span>).html(response);});</div><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; ">Here we had to pass the selected value of DdlContact. The JQUERY function, <span style="color: rgb(153, 0, 0); ">val()</span> gets the value of selected option. </span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="color: rgb(204, 0, 0); font-weight: bold; font-family:verdana;">Note: No matter what way we load the dropdowns, up to about 2000 options it works fine. The moment we start going higher, even though the html is sent within seconds to the client side, the browser becomes sluggish in rendering the drop down. When the options were increased beyond 4000, the browser stopped responding even though response had come back in a few seconds.</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style=" font-weight: bold; font-size:16px;">Please feel free to post questions / comments for this article at the following link.</span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="font-weight: bold; "><span style=" ;font-size:large;"><span style=" ;font-family:verdana, sans-serif;">Screen shots of the application in action</span></span></span></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><table border="1" border cellspacing="0" style="border-collapse: collapse; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(238, 238, 238); margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; background-position: initial initial; color:#888;"><tbody><tr><td style="width: 824px; height: 15px; vertical-align: top !important; "> <span style=" ;font-family:verdana, sans-serif;"><span style="font-weight: bold; ">Initial screen with contact and their emails waiting to be loaded</span></span></td></tr></tbody></table><span style="font-weight: bold; "><br /></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1.JPG?attredirects=0" imageanchor="1" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div><span style="font-weight: bold; "><div style="display: block; text-align: left; "><br /></div><span style="font-weight: normal; "><table border="1" border cellspacing="0" style="border-collapse: collapse; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: rgb(238, 238, 238); margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; color:#888;"><tbody><tr><td style="width: 824px; height: 15px; vertical-align: top !important; "> <span style=" font-weight: bold; font-family:verdana;">On the select of a contact, an AJAX call is made to load the corresponding emails</span></td></tr></tbody></table></span></span><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_1.JPG?attredirects=0" imageanchor="1" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_1.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div><div style="display: block; text-align: left; "><br /></div><table border="1" border cellspacing="0" style="border-collapse: collapse; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: rgb(238, 238, 238); margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; color:#888;"><tbody><tr><td style="width: 824px; height: 15px; vertical-align: top !important; "> <span style=" font-weight: bold; font-family:verdana;">Emails are loaded almost instantaneously</span></td></tr></tbody></table><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_2.JPG?attredirects=0" imageanchor="1" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_2.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div><div style="display: block; text-align: left; "><br /></div><table border="1" border cellspacing="0" style="border-collapse: collapse; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: rgb(238, 238, 238); margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; color:#888;"><tbody><tr><td style="width: 824px; height: 15px; vertical-align: top !important; "> <span style=" font-weight: bold; font-family:verdana;">Creating a sample content</span></td></tr></tbody></table><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_3.JPG?attredirects=0" imageanchor="1" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_3.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div><div style="display: block; text-align: left; "><br /></div><table border="1" border cellspacing="0" style="border-collapse: collapse; border-top-color: rgb(136, 136, 136); border-right-color: rgb(136, 136, 136); border-bottom-color: rgb(136, 136, 136); border-left-color: rgb(136, 136, 136); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: rgb(238, 238, 238); margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; color:#888;"><tbody><tr><td style="width: 824px; height: 15px; vertical-align: top !important; "> <span style=" font-weight: bold; font-family:verdana;">Sample content is received from server in formatted manner</span></td></tr></tbody></table><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p><div style="display: block; text-align: left; "><a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_4.JPG?attredirects=0" imageanchor="1" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); cursor: text; "><img border="0" src="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtoimplementcascadingdropdownsusingjqueryajaxandaspnet/SendEmailScreenshot1_4.JPG" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></a></div><br /><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "></p></span></div></div></span>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-49911867662227476462009-04-01T10:03:00.000+05:302009-04-01T10:09:36.546+05:30How to submit a form using JQuery via AJAX to an ASP.NET and receive the response<span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; ">The purpose of this article is to showcase how to submit a form to an ASP.NET Page via AJAX using JQuery. Why would we use AJAX to submit a form when developing an ASP.NET application? That is an application design question. However, if it has been decided that AJAX will be used, then JQuery can help you make your codebase smaller and also make the code cross-browser compliant. JQuery does a lot more and for that please feel free to refer to the JQuery site (<a href="http://jquery.com/" rel="nofollow" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); "><span style="text-decoration: none; ">http://jquery.com/</span></a>). </div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><p style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: black; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The sample application revolves around accepting some contact details, posting them to an ASP.NET form and then displaying the data received by the server. The sample code can be downloaded from the following zip. </p><p style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: black; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Source: <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/contactmanagement.zip?attredirects=0" title="ContactManagement.zip" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; "><span style="text-decoration: none; ">contactmanagement.zip</span></a> </p><p style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: black; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Solution Screenshot </p><p style="text-decoration: underline; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: black; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><img src="http://sites.google.com/site/spyderhoodcommunity/_/rsrc/1238507932728/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/SolutionView.JPG" /></p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0in; "><strong>Steps</strong></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>1. </span>The first step will be to get the uncompressed version of JQuery script file. The file can be downloaded from <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.js&downloadBtn=" style="outline-style: none; outline-width: initial; outline-color: initial; color: rgb(85, 26, 139); "><span style="text-decoration: none; ">http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.js&downloadBtn=</span></a></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>2. </span>Next, create a default asp.net website and rename default.aspx to “SaveContact.aspx”</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>3. </span>You may also have to add a web.config file from add new items as in VS 2005, it may not add by default for a website</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>4. </span>Open “SaveContact.aspx” in the designer and remove all the HTML tags (see <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/ViewSaveContactDesigner.JPG?attredirects=0" target="_blank" title="SaveContact.aspx HTML view" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; "><span style="text-decoration: none; ">screenshot</span></a>) </div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><p style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: black; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span>5. </span>Add default.htm and include the jquery script file and create the form shown in the code snippet (see <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/defaulthtml.JPG?attredirects=0" target="_blank" title="HTML code for default.htm" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; "><span style="text-decoration: none; ">screenshot</span></a>) </p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>6. </span>Now add the jquery function to submit the form and receive the results as shown in the code snippet (see <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/defaultjquery.JPG?attredirects=0" target="_blank" title="JavaScript for default.html" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; "><span style="text-decoration: none; ">screenshot</span></a>) </div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>7. </span><span style="font-weight: bold; ">$() </span>represents the JQuery object</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>8. </span>The <span style="font-size: 10pt; line-height: 115%; "><span style="font-weight: bold; ">$(document).ready() </span></span>ensures that no javascript is executed till the page is ready with all the dom elements loaded</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>9. </span><span style="font-size: 10pt; line-height: 115%; "><span style="font-weight: bold; ">$(</span><span style="color: rgb(163, 21, 21); "><span style="font-weight: bold; ">"#submit_btn"</span></span><span style="font-weight: bold; ">).click()</span> </span>searches for an element with ID as submit_btn and adds a function to the click event</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>10. </span><span style="font-weight: bold; ">$.post</span> expects 3 arguments</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>a. </span>The name of the page to which the form will be posted</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>b. </span>The arguments which need to be posted</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 1in; text-indent: -0.25in; "><span>c. </span>The function to be called on receiving the response</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>11. </span>The return false ensure that the there is no page refresh after the call is completed</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>12. </span>Response contains the entire HTML output of SaveContact.aspx</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>13. </span>Here we have taken the response set it to the inner HTML of a DIV using <span style="font-size: 10pt; line-height: 115%; "><span style="font-weight: bold; ">$(</span><span style="color: rgb(163, 21, 21); "><span style="font-weight: bold; ">"#DivResult"</span></span><span style="font-weight: bold; ">).html(response).show()</span></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>14. </span><span style="font-size: 10pt; line-height: 115%; "><span style="color: rgb(153, 0, 0); "><span style="font-weight: bold; ">#</span></span> </span>is the keyword used to refer to a the ID of an element.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>15. </span><span style="font-size: 10pt; line-height: 115%; "><span style="font-weight: bold; ">.html()</span> </span>is a function in JQuery to update the inner HTML. You can also use the same function to get the inner HTML.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>16. </span><span style="font-size: 10pt; line-height: 115%; "><span style="font-weight: bold; ">Show()</span> </span>causes the div to be displayed immediately, even if it is hidden. This is particularly useful if you keep your div hidden by default.</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>17. </span>On the code behind of SaveContact.aspx, add the code in the <a href="http://sites.google.com/site/spyderhoodcommunity/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/SaveContactCodeBehind.JPG?attredirects=0" target="_blank" title="Code behind of SaveContact.aspx" style="color: rgb(0, 102, 204); outline-style: none; outline-width: initial; outline-color: initial; "><span style="text-decoration: none; ">screenshot</span></a> </div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0pt; margin-left: 0.5in; text-indent: -0.25in; "><span>18. </span>While it is quite possible to save the received result into a database writing simple ADO.NET code, the purpose of this article was to keep focus on the core aspect, i.e., showcase how we can bring the data and submit a response</div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 10pt; margin-left: 0.5in; text-indent: -0.25in; "><span>19. </span>Given below is the screen shot of a sample input and output generated from the code. Please feel free to try any other data too. </div><span style="font-size: 11pt; "><div style="text-decoration: underline; "><img src="http://sites.google.com/site/spyderhoodcommunity/_/rsrc/1238507932707/tech-stuff/howtosubmitaformusingjqueryviaajaxtoanaspnetandreceivetheresponse/Screenshot.JPG" /></div>The application has been tried on IE7, Firefox 2+ and Chrome 1+. Barring a few discrepancies in the UI, the functionality is the same in all 3 browsers.</span></span><div><br /></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com3tag:blogger.com,1999:blog-7732948924267700961.post-12253775475998039222009-03-30T15:11:00.000+05:302009-03-30T15:13:15.510+05:30Recommended strategy for handling exceptions in dot net applications<p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><b><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Purpose of this article</span></b><span style="font-size:10.0pt; line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma;color:#444444"> </span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p> <ol style="margin-top:0in" start="1" type="1"> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l3 level1 lfo4;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Take advantage of the good exception handling practices</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l3 level1 lfo4;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">To provide a structured approach in handling exceptions</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> </ol> <p class="MsoNormal" style="margin-bottom:2.25pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p> </o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">There is a significant amount of debate in my workplace about how much of exception handling is enough and what really should be the scope of exception handling. Without getting into the debate myself, I am going to present my views on the scope, benefits, drawbacks and the most appropriate way of handling exceptions in dot net projects. </span><span style="font-size: 10.0pt;line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman";color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><b><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Scope</span></b><span style="font-size:10.0pt;line-height:130%; font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:Tahoma;color:#444444"> </span><span style="font-size: 10.0pt;line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman";color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Exceptions are not expected to occur but are known to happen when either there is a flaw in the coding or the system has received data it is not equipped to handle. Professed exceptions that are raised within code due to foreseen circumstances such as, duplicate record entry, etc should not stop the program execution. The user should be displayed an appropriate</span><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;line-height:130%;font-family: "Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-font-family: Tahoma;color:#444444"> </span><b><span style="font-size:10.0pt;line-height: 130%;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:Tahoma;color:#444444">warning</span></b><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;line-height:130%;font-family: "Verdana","sans-serif";mso-fareast-font-family:"Times New Roman";mso-bidi-font-family: Tahoma;color:#444444"> </span><span style="font-size:10.0pt;line-height: 130%;font-family:"Verdana","sans-serif";mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:Tahoma;color:#444444">message and allowed to take corrective action. The true exceptions should be, </span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p> <ol style="margin-top:0in" start="1" type="1"> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l2 level1 lfo1;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Logged at the first occurrence location into a log file</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l2 level1 lfo1;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">A new custom exception with only those exception details that may be used within the code and the exception class inheriting from ApplicationException should be created and rethrown.</span><span style="font-size:10.0pt;line-height:130%;font-family: "Tahoma","sans-serif";mso-fareast-font-family:"Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l2 level1 lfo1;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">This custom exception should be caught and rethrown across all levels till we reach an event handling method (e.g.: catch(CustomException) { throw; }.</span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l2 level1 lfo1;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">The user should be redirected to an error page which displays some summary details of the exception and any standard message to the user that may suit the need of the application.</span><span style="font-size:10.0pt;line-height:130%; font-family:"Tahoma","sans-serif";mso-fareast-font-family:"Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l2 level1 lfo1;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">The same error page could allow the user to bring this exception to the notice of a designated authority (maybe a web admin) via email created in a rich text environment (also allowing snapshots to be attached). This is important if the exception can keep occurring every time the user revisits the involved activity keep the user from carrying on with his / her tasks. However, this may be more useful in the case of intranet applications. Public portals could cause a deluge!</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> </ol> <p class="MsoNormal" style="margin-bottom:2.25pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444"> </span><span style="font-size:10.0pt;line-height:130%; font-family:"Tahoma","sans-serif";mso-fareast-font-family:"Times New Roman"; color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><b><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Details that should go into an Exception and its message</span></b><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Typically, there are two kinds of exceptions that will occur. The first kind is thrown by the system and the second kind is thrown from the code. In the former case,, post logging, you should replace it with your own exception object (inheriting from ApplicationException class). </span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">In the case of your wanting to throw an exception, the message should contain the following information, </span><span style="font-size: 10.0pt;line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman";color:#444444"><o:p></o:p></span></p> <ol style="margin-top:0in" start="1" type="1"> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l1 level1 lfo2;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">The method name which first caught / invoked the exception.</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l1 level1 lfo2;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">The class name (whether it’s a web page or windows form or a library class) which contains the method mentioned in point 1.</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l1 level1 lfo2;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Some details of the cause of exception / the activity that has been affected by this exception.</span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman""><o:p></o:p></span></li> </ol> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444"> Additional information may be provided as per the application requirements. </span><span style="font-size:10.0pt;line-height: 130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family:"Times New Roman"; color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><b><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">Proposed Framework for Exception Handling in an Application</span></b><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p> <ol style="margin-top:0in" start="1" type="1"> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l0 level1 lfo3;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Catch and throw exceptions as proposed in the above sections</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l0 level1 lfo3;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Log the exception to a log file the first time it is caught</span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l0 level1 lfo3;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Display a user expectation friendly error page when exceptions occur giving the facilities mentioned above</span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman""><o:p></o:p></span></li> <li class="MsoNormal" style="color:#444444;margin-bottom:2.25pt;line-height: 130%;mso-list:l0 level1 lfo3;tab-stops:list .5in"><span style="font-size: 10.0pt;line-height:130%;font-family:"Verdana","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:Tahoma">Run a background service that periodically clears the log file entries and transfers them to a database for analysis of application state. Alternatively, you can log the exceptions to a database straight away and keep the log file as a backup plan incase the database is unresponsive.</span><span style="font-size: 10.0pt;line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman""><o:p></o:p></span></li> </ol> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444"> <b>Footnote</b> </span><span style="font-size:10.0pt; line-height:130%;font-family:"Tahoma","sans-serif";mso-fareast-font-family: "Times New Roman";color:#444444"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom:16.2pt;line-height:130%"><span style="font-size:10.0pt;line-height:130%;font-family:"Verdana","sans-serif"; mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:Tahoma; color:#444444">The details mentioned so far are more with respect to dot net (c#, vb.net, asp.net) applications and specific applications, especially scientific or time critical applications may require a different approach to exception handling. I am sure that there may be scenarios / options / issues that have not been mentioned explicitly in this article. Anyone contributing to this article would be appreciated. I am also more than willing to provide further information on specific questions.</span><span style="font-size:10.0pt;line-height:130%;font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman";color:#444444"><o:p></o:p></span></p>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0tag:blogger.com,1999:blog-7732948924267700961.post-1570734684754342472008-12-09T15:40:00.000+05:302008-12-09T15:55:59.101+05:30Politics in India - Where are we going?<div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">5 states' election results have come through. I do not know whether to look at the glass as half empty or half full.</span></div><div><br /></div><div>On the one hand Congress has survived BJP's targeting of the Mumbai terrorist incident (which, personally I found deplorable). On the other hand, regional parties (read: parties with caste/community based agendas) are still making a dent in the vote share.</div><div><br /></div><div>Even today, the majority of voters do not come from Metro cities. They come from the villages and towns. What do they want? If this is not clear, it is not because the voters do not know what they want, but they simply do not have enough options.</div><div><br /></div><div>A heartening result was that Uma Bharti's party failed to make an impact. Otherwise, who knows?</div><div><br /></div><div>I cannot speak on behalf of all the voters in India, but the following is what I would really like to start seeing in election manifestos rather than ideological rhetoric:</div><div><br /></div><div>1. The party coming to power will have an array of ministries to look after</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1.1 what is their agenda for each ministry?<br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1.2 who are the people who they will choose for which ministry? What are their<br /></div><div> qualifications?</div><div>2. What work has the local candidate done in the constituency he / she is standing from?</div><div>3. How will they target reduction in corruption (yes, it will not go away instantly)? This still </div><div> remains the largest root cause for almost all the problems this country has</div><div><br /></div><div>Incidently, the parties / candidates funding should be transparent. We should be able to know which corporates are supporting them, besides there should be an easy way for the parties to receive "donations" from the public.</div><div><br /></div><div><span class="Apple-style-span" style="text-decoration: underline;">Until then, the voters will continue to have a difficult time in voting for a candidate who is qualified and will work to make this country better.</span></div><div><br /></div><div><br /></div>Spyderhttp://www.blogger.com/profile/02223531671854478117noreply@blogger.com0