Tuesday, October 14, 2014

Send an Email Using C# .NET

To Send an email using C# .NET

What is classes and method

Classes & Method in ASP.NET .

protected void Page_Load(object sender, EventArgs e)
        //Create object of class
        CommonClass objCommonClass = new CommonClass();

        //Call sum function by passing 2 parameters
        int intSum1 = objCommonClass.Sum(10, 20);
        Response.Write("Sum1 = "+intSum1);

        //Call sum function by passing 3 parameters
        int intSum2 = objCommonClass.Sum(10, 20,30);
        Response.Write("Sum2 = " + intSum2);
public class CommonClass
    //public is access modifier
    //int return type
    //Sum is name of function
    //x,y are the parameters
    public int Sum(int x, int y)
        return x + y;

    public int Sum(int x, int y, int z)
        return x + y + z;

Wednesday, September 17, 2014

A potentially dangerous Request.Form value was detected from the client

Server Error in 'ASP.Net' Application.

A potentially dangerous Request.Form value was detected from the client (TextBox1"=<p>Hello</p>").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBox1="<p>Hello</p>").
To Prevent from SQL Injections, ASP.NET by default does not allow HTML tags "<",">" 
It is recommended to allow this check to happen on each postback.
Sometimes you need to submit HTML Content to your page through Rich TextBoxes or Rich Text Editors. In that case you can avoid this exception by setting the ValidateRequest tag in the @Page Directive to false.
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest = "false"
This will disable the validation of requests for the page you have set the ValidateRequest flag to false. 
To disable request of all page you’ll need to set ValidateRequest   false in your web.config <system.web> section
<pages validateRequest ="false" />
For .Net 4.0 or higher frameworks you will need to also add the following line in the <system.web> section to make the above work.
<httpRuntime requestValidationMode = "2.0" />
That’s it. Hope this helps you in getting rid of the above issue.

Wednesday, August 13, 2014

Firefox Not Responding

Firefox is not responding

Your Firefox Browser not responding. It stops for few seconds when you open any site.

Don't frustrate and try the below solution it would really help you

Go to Help Tab and Select Troubleshooting Information.

On the right side of the page, under the "Reset Firefox to its default state" section, click the "Reset Firefox ..." button.

Firefox will save some old browser information to a folder on your Desktop, and then reset the   web browser to the Firefox defaults. (Your Bookmarks won't get deleted). I don't think I'll need this folder for anything and I'll just delete it in a couple of days.

Firefox will restart and work normally again!

Sunday, August 10, 2014

Free Serial Key of any Software

Easy Way To Find Serial Key Of Any Software By Using Google
Don’t waste your valuable time to search serial key of any software. Just do a trick and save your time to get the serial key of any software. Below are the steps to find the serial key

For Serial Key Of Any Software Just Follow These Simple Steps
1) Go To Google

2) Now Type Software Name And 94FBR

3) For Example If I Want To Find Serial Key Of Avast Then I Will Type Avast 94FBR

4) Finally Press Enter And Then You Will Easily Find The Serial Key Of The Software That You Entered

Monday, June 16, 2014

Search Text From All Store Procedure in SQL

Use the below Query to search text in all Store Procedure

SELECT DISTINCT o.name AS Object_Name,o.type_desc
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON m.object_id=o.object_id
WHERE m.definition Like '%\[SearchText\]%' ESCAPE '\'