Category: Asp.Net

Posted in Asp.Net c#.net MVC Uncategorized

Generate and Download PDF file on Ajax Post method, C#

Requirements: On ajax post, save data to database, generate invoice and download as PDF file. There are…

Posted in Asp.Net Uncategorized

Most important topics

Static Constructor A static constructor is used to initialize the static data once or performed an action…

Posted in Asp.Net c#.net JavaScript Uncategorized

UK Postcode Validation

Regular expression for JavaScript var regPostcode = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/; var result = regPostcode.test(SearchTerm); if (!result) { alert(“Please…

Posted in Asp.Net c#.net Uncategorized

Remove illegal characters from file name or file path in c#

File cannot be saved if file name has illegal characters. So how to remove the illegal characters…

Posted in Asp.Net Uncategorized

How to display Progress bar while page is loading

<pre> <code> protected void Page_Load(object sender, EventArgs e) { showPageLoad(); //do somthing     } private void showPageLoad()…

Posted in Asp.Net c#.net Uncategorized

Export DataTable to Excel/CSV C#

protected void btnExport_Click(object sender, EventArgs e) { DataTable dtTable = new DataTable(); DataRow dtRow; dtTable.Columns.Add(“SNo”, typeof(int)); dtTable.Columns.Add(“Address”,…

Posted in Asp.Net Uncategorized

calling [Ajax.AjaxMethod()] not working

finally its resolved by using, <system.webServer> <validation validateIntegratedModeConfiguration=”false” /> <modules> <add name=”ScriptModule” preCondition=”integratedMode” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,…

Posted in Asp.Net Uncategorized

Country wise TimeZones SQL DB

This time zone list use only for .Net Users.. Because .Net has inbuilt class for converting date-time…

Posted in Asp.Net Uncategorized

404 error WCF on server

Add below lines undser System.Server / handler section. <add name=”svc-ISAPI-2.0″ path=”*.svc” verb=”*” modules=”IsapiModule” scriptProcessor=”%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll” resourceType=”Unspecified” preCondition=”classicMode,runtimeVersionv2.0,bitness32″ />…

Posted in Asp.Net Netoworking Uncategorized

Import SSL, Auto redirect http to https, Custom Error Page lock violation

Import SSL in IIS 7 For importing SSL certificate, the certificate should have in PKCS #12 format…