Categories
Uncategorized

Check if a File exists using C#

If you want to check if a specific file exists on a local machine at a particular path using C# programming language, you can do so by using the File.Exists() method. To use this first you need to import the System.IO namespace. using System.IO; Next, below is a sample code that checks if a file […]

Categories
Uncategorized

How to call an action from javascript or jquery in MVC 3 Razor

New article written at : How to call web api method using jquery ajax in ASP.NET MVC 4 Here there are two different requirements that I will look into 1. How to call an action form javascript or jquery and get a return value and then maybe use it somewhere on the view. Below is an […]

Categories
Uncategorized

How to override all styles in CSS

I recently came across a very unique requirement, I wanted to change all font-family(s) I had used for this site. I had defined font-family at many different places in divs, spans, h1s, h2s and where not, so I wanted some shortcut way to do this. Here is what I had used, {code type=CSS} * { […]

Categories
Uncategorized

How to change WordPress Address and Site Address

There are 3 ways in which you can change the WordPress Address URL and Site Address URL, but first let us know what these URL actually mean. The “Wordpress Address URL” setting is the address you want people to type in their browser to reach your WordPress blog.The “Site Address URL” setting is the address […]

Categories
Uncategorized

Write to an Event Log using C#

Event logging provides a standard, centralized way for your applications to record important software and hardware events. string eventSource, strlog, message; eventSource = “YasserSource”;strlog = “LogDetails”;message = “This is my error message”; // Creates an event source if it does not existsif (!EventLog.SourceExists(eventSource)) {EventLog.CreateEventSource(eventSource,strlog);} EventLog.WriteEntry(eventSource, message, EventLogEntryType.Error); Be sure you include System.Diagnostics;

Categories
Uncategorized

Give a common CSS to all input tags

You may want to give all input tags a common CSS. That is you want all your Text Fields, Password Fields, Radio button, Submit buttons etc… all to have a common CSS. This can be done easily by simply including the below code in your CSS file as shown below. Here I am giving all […]

Categories
Uncategorized

Show text on image hover

Show text on image hover : It is a common requirement to show a text on hover of an image. I recently wanted to do the same. Below is the straight forward and simple solution for the same. Using the title tag, we can easily do so, check the code below {code type=html} <img src=”http://yassershaikh.com/wp-content/uploads/2012/03/sp-studio-1.jpg” alt=”My […]

Categories
Uncategorized

Hide Feedjit Feed in WordPress

Feedjit is clearly one of the best FREE traffic tracking widget available on the internet. You can install and use it with your WordPress blog or Blogger blog or on any other website. It is very simple to install and customize a Feedjit widget to a blog. You may also want to hide your Feedjit […]

Categories
Uncategorized

OOPS Interview Questions and Answers

Q. What is Object Oriented Programming?A. Object-oriented programming (OOP) is a programming paradigm using “objects” (data structures consisting of data fields and methods together with their interactions) to design applications and computer programs. Q. What is an Object?A. An object is an instance of a class. Q. What is a Class?A class is the blueprint […]