Category: Uncategorized

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 SQL Server Uncategorized

Cube and Rollup Operator in SQL Server 2008

CUBE operator is used with Group by clause. It use to get the subtotal and grand total…

Posted in SQL Server Uncategorized

Insert multiple rows into a table from another table and get identity values

Let me explain the case first, so you will get the idea when this is required to…

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 SQL Server Uncategorized

SQL Server Transaction

BEGIN TRANSACTION BEGIN TRY — put SQL commands here INSERT/UPDATE/Delete — if successful – COMMIT the work…

Posted in MVC Uncategorized

Selected value not set on DropDownListFor() in MVC

Let me tell you small story. There is a ‘title’ column name for salutation in database. Based…

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 c#.net Uncategorized

Download / Upload Files on FTP Server

Require following ftp details where you want to upload the files: FTP URL: “ftp://ftp.yoursite.com/” FTP Username: username…