Posts

Showing posts from 2010

3 Ways to Send Emails with dynamic content in ASP.NET

To send email from asp.net application, we have followed various approaches in past 1. Create & design HTML file, Use place holder to find and replace. Pros: If you are sending one type of email. Easy to test the layout in different browsers. Cons: if you are sending multiple types of email but for email format or layout is same. Difficult to maintain Performance slow, due to disk read operation. Difficult to Test in different browser with dynamic data. 2. Create XSLT file, transform by passing your custom object. Pros: if you know xslt and only one type of email you want to send. Cons: Xslt knowledge is required Difficult to maintain, If you have to send multiple type of dynamic email content with same email format or layout. Very difficult to debug. Some Performance hit. 3. Create two asp.net User controls, one master user control & one is child user control. Master user control will be similar to asp.net master page. To keep email outer email body template in one location.

Tips & Trick to improve your productivity

To boost my skill & productivity, I read open source code, VS IDE short cut, NUnit,Modifying Class template. etc. For all small work I create batch file. 1. Backup my Db. 2. Automate build for dev to test server. 3. web service prox generation. 4. IIS reset & clean Asp.net cache. etc. Here are some more good links. blog.interviewstreet.com 8-reasons-for-re-inventing-wheel-as projecteuler

Automated white-box testing of .NET applications using PEX Framework

The PEX Framework is a Visual Studio 2010 Powertool for automated white-box testing of .NET applications. Implemented as a Visual Studio add-in, PEX was developed by Microsoft Research and can be downloaded here . Once installed, PEX lets you automatically generate test suites with high code coverage. Unlike other unit testing tools, PEX suggests fixes to potential bugs it detects in your code. PEX is capable of performing an analysis on your application's code, searching for boundary conditions, generating test cases, searching for assertion failures and ultimately reducing maintenance costs. In this article, I examine the PEX Framework and show how you can integrate it with Visual Studio to create better unit tests with high code coverage. Andre Marion : Pex is definitely intriguing. What is Microsoft doing in the way of trying to catch up and develop tools like the Ruby community has, such as Rspec, Sinatra, Rake, Cucumber, Rails, etc... More Info Links: downloads Article By Jo

ASP.NET Open Source Projects

I have used bloggerEngine.Net for blog and DotNetNuke for CMS. I found this is very good. List of other open source Blogs site Blogsa.net - A blog engine in Asp.net dasBlog BlogEngine.NET SubText - A blogging engine in ASP.NET Owlpal - Web Content System AtomSite (formerly BlogSvc) - Built using ASP.NET MVC. Oxite - Built using ASP.NET MVC. Content Management Systems DotNetNuke Kooboo CMS N2CMS Umbraco sharpcms Mojoportal Orchard CMS http://wiki.asp.net/page.aspx/388/aspnet-open-source-projects/

Check the firewall on the server & open port

You can do this by running the following command in a prompt : netsh firewall show portopening If you get an empty list, no firewall is on, if you see a list, check that there is a line containing the correct port : standard it is 21234 To open the port, run the following command : netsh firewall add portopening TCP 21234 CCNET

A critical error has occurred.Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I solved this problem by changing the event name. There was two classes having same event name. Both class is used in two user control. And two user control placed on one page. This was creating problem. My System environment: Win Server 2008 R2 IIS 7 - 64 bit VS 2010 .Net 3.5

AnkhSVN is a Subversion SourceControl Provider for Visual Studio

AnkhSVN is a Subversion SourceControl Provider for Visual Studio. The software allows you to perform the most common version control operations directly from inside the Microsoft Visual Studio IDE. http://help.collab.net/index.jsp?topic=/com.collabnet.doc.anksvn_001/action/ankh_getting_started.html http://ankhsvn.open.collab.net/ankhsvn/contributing#source http://ankhsvn.open.collab.net/ankhsvn/features

hide-file-in-picture

http://www.online-tech-tips.com/computer-tips/hide-file-in-picture/

Delete .svn files

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"

XPath Tutorial e.g Google Maps API Web Services

http://code.google.com/apis/maps/documentation/webservices/

linqpad

http://www.linqpad.net/

ASP.NET application and page life cycle

http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx?display=Print Prize winner in Competition "Best ASP.NET article of April 2010"

Navigation using window.location

//Navigates to a new page and creates a browser history item. window.location.assign("http://TundraBlue.com"); //Navigates to a new page and replaces the current page in browser history. window.location.replace("http://TundraBlue.com"); //Reloads the current location from the server no browser history item is created. window.location.reload("http://TundraBlue.com");

Refrence link

http://alpascual.com/blog/al/archive/2007/03/26/Code-Snip-_2200_Customizing-ScriptManager_2200_-to-detect-errors.aspx http://adilakhter.wordpress.com/2008/01/11/using-predicate-actor-of-net20/ http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.aspx http://adilakhter.wordpress.com/2008/01/11/passing-parameter-to-a-predicate-in-net20/ http://lspence.blogspot.com/2008/01/how-to-auto-collapse-microsoft-ajax.html http://www.ajaxlines.com/ajax/stuff/article/ajax_toolkit_collapsible_panel_extender.php http://alpascual.com/blog/al/archive/2007/04/26/How-to-fix-Sys.WebForms.PageRequestManagerParserErrorException-in-AJAX.aspx--%> http://alpascual.com/blog/al/archive/2007/03/26/Code-Snip-_2200_Customizing-ScriptManager_2200_-to-detect-errors.aspx http://developers.de/blogs/damir_dobric/archive/2007/02/12/RegisterStartupScript-and-RegisterClientScriptBlock-can-work-with-UpdatePanel_3F002100_.aspx http://gmamaladze.googlepages.com/maintainfocusbetweenpostbacksalsoinasp.n http://ry

NAT example

http://technet.microsoft.com/en-us/library/cc780783(WS.10).aspx then network address translation (NAT) maps all private addresses on 192.168.0.0 to the IP address of w1.x1.y1.z1. If multiple private addresses are mapped to a single public address, NAT uses dynamically chosen TCP and UDP ports to distinguish one intranet location from another. Note The use of w1.x1.y1.z1 and w2.x2.y2.z2 is intended to represent valid public IP addresses as allocated by the Internet Assigned Numbers Authority (IANA) or an ISP. The following illustration shows an example of using NAT to transparently connect an intranet to the Internet. If a private user at 192.168.0.10 uses a Web browser to connect to the Web server at w2.x2.y2.z2, the user's computer creates an IP packet with the following information: Destination IP address: w2.x2.y2.z2 Source IP address: 192.168.0.10 Destination port: TCP port 80 Source port: TCP port 5000 This IP packet is then forwarded to the NAT protocol, which translates the

List of HTTP status codes

1xx Informational 2xx Success 3xx Redirection 4xx Client Error 5xx Server Error

RenderUserControl by pasing parameters

public static string RenderUserControl(string path, NameValueCollection nvc) { Page pageHolder = new Page(); UserControl viewControl = (UserControl)pageHolder.LoadControl(path); if (nvc != null && nvc.Count > 0) { Type viewControlType = viewControl.GetType(); foreach (string key in nvc.Keys) { PropertyInfo property = viewControlType.GetProperty(key); property.SetValue(viewControl, nvc[key], null); } } pageHolder.Controls.Add(viewControl); StringWriter output = new StringWriter(); HttpContext.Current.Server.Execute(pageHolder, output, true); return output.ToString(); }

testdriven.net NUnit debug

http://www.testdriven.net/download_release.aspx?LicenceType=Personal

Add tab Index and background

jQuery(document).ready(function() { jQuery("#Body").addClass("bgnd"); jQuery(function(){ var tabindex = 1; jQuery('input,select,.RELIndexer,textarea').each(function() { if (this.type != "hidden") { var jQueryinput = jQuery(this); jQueryinput.attr("tabindex", tabindex); tabindex++; } }); }); });

EnterToClick

//do postback on press of "enter key" function EnterToClick(ctrId, e, arg) { var keyCode = (e.keyCode) ? e.keyCode : e.which; if(keyCode == 13) { __doPostBack(ctrId, arg); } } onkeydown="javascript:EnterToClick('<%=imgbtnLoginNow.UniqueID %>', event, 'Login Now');"

Execute Link

function SearchImage(obj, e, arg) { eval(jQuery("#" + obj.id + " a.CommandButton" )[0].href) }

log4net

http://log4net.sourceforge.net/release/1.2.0.30714/releasenotes.html

Castle.ActiveRecord.dll

http://www.castleproject.org/monorail/gettingstarted/ar.html 1.First of all, add references to the following assemblies: ◦Castle.ActiveRecord.dll ◦Castle.DynamicProxy.dll ◦Iesi.Collections.dll ◦log4net.dll ◦NHibernate.dll ◦NHibernate.ByteCode.Castle.dll

Castle.ActiveRecord.dll

http://www.castleproject.org/monorail/gettingstarted/ar.html

SharpZipLib, formerly NZipLib

http://www.icsharpcode.net/opensource/sharpziplib/ Developers look to Xceed Zip for .NET, community sponsor of SharpZipLib, when they need advanced Zip and streaming compression capabilities. Sponsor #ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language). The creator of #ziplib put it this way: "I've ported the zip library over to C# because I needed gzip/zip compression and I didn't want to use libzip.dll or something like this. I want all in pure C#."

Process Explorer v12.03

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

JR Screen Ruler

http://www.spadixbd.com/freetools/

Unlocker is the solution

http://ccollomb.free.fr/unlocker/ http://www.brothersoft.com/download-unlocker-208761.html
Virtual CD-ROM Control Panel v2.0.1.1 http://www.softpedia.com/progDownload/Virtual-CDROM-Control-Panel-v-Download-16468.html