Coding Cluster

Find total number of vowels in a string in JavaScript:
This article explain how to find Vowels in a String and how to find total number of vowels in a string in JavaScript. I have written simple script for checking vowels in a string in JavaScript. I have used regular expression.

C# Get All Files from a Folder:
This post shows how to get list of file names from a directory (including subdirectories). You can filter the list by specific extension.
To get file names from the specified directory, use static method Directory.Get­Files. Lets have these files and subfolders in "d:\YourDir" folder:

In this tutorial you will learn how to send attachment with email in asp.net using c#. To send an email with attachments, the ASP.NET process (or the ASP.NET impersonated account) will need permission to read the file, and attach it to the MailMessage class. You can attach a file using FileUpload Control and put the file in memory stream. In this example I'm using smtp.gmail.com as my SMTP server. You can put your gmail login credentials and send mail with attachment.

'System.Array' does not contain a definition for 'Count' and no extension method 'Count' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

To resolve this server side error you just add the following namespaces,

using System.Linq;

at the top of your source and make sure you've got a reference to the System.Core assembly.

Converting all text in textbox into UPPERCASE / lowercase:
Converting a text string to uppercase is very easy using the JavaScript toUpperCase() method and in the same way the toLowerCase() method is used to converting a text string to lowercase. The following code and example shows how this works:
Example:

In this article a GridView that has a number of buttons that you need to enable or disable all at once and don't want to have to force a post back on your users in order to loop through them all. By using only a simple js function.

When a GridView renders on the page, it is simply an HTML table and you can traverse it just like you would any other HTML table using JavaScript.

The following code to do a basic version of this in order to enable or disable all buttons in a GridView. First the code gets an instance of the GridView using the ClientID of the GridView, then create a collection of all input controls in the GridView. Next it loops through each input control and checks the type (this is necessary because input controls include not only submit buttons but also things like textboxes). Finally we either enable or disable the submit button.

Change font size of a row in tableview:
Copy and paste the following code into your tableView's cellForRowAtIndexPath method to change the font size of a row in a table view and set the number of line to display in a row.

Code:

//Setup the cell...
cell.textLabel.font = [UIFont systemFontOfSize:12]; //Change this value to adjust size
cell.textLabel.numberOfLines = 3; //Change this value to show more or less lines.
cell.textLabel.text = @"Your Text";