Showing posts from 2012

How to print a web page using javascript.

In this web Programming tutorial we will learn that how we can add Printing functionality on our web page using javascript in a asp.net or simple html page. see the below code and just copy and paste it. Code to use in HTML part you want to prin…

how to shutdown you computer from website in asp.net using c#

In this web-healer.blogspot.com 's web programming tutorial we will learn that how we can shutdown our computer by clicking on a button from our website. So below is the dream code just copy and paste it. and use it in your button's onClick e…

how to sow date and time on a asp.net page using c#

In this web-healer.blogspot.com 's web programming tutorial we will learn that how we can show simple date and time on our web page in asp.net using c#. just copy and paste the below code. if (!Page.IsPostBack) { lbl_date.T…

import to excel in asp.net using c#

In this web programming tutorial we will learn that how we can import our Gridview data into excel file by click on a link button from our webpage in asp.net using c#. protected void LinkButton1_Click(object sender, EventArgs e) { Resp…

how to clear all gridview elements in aps.net using c#

In this simple web Programming tutorial we will learn that how we can clear all Controls available in a gridview by just one click instead clearing one by one. like as we clear a form's text fields or other form elements. just copy the below code…

how to define session as string in asp.net using c#

In this simple web programming tutorial we will learn that how we can define a Session as string in asp.net using C# to assign it to a string veriable. see the written below code and just copy and paste it. string data = Session["Data_var&q…

Format String into Money Format in asp.net using c#

In this programming Tutorial we will learn that how we can format amount string into money. below is the code just copy and paste and use it. string charges = "125.35"; lbl_charges_total.Text = string.Format("{0:###,###,##0.00}&quo…

how to add new row in gridview in asp.net using c#

In this web programming tutorial we will learn how we can add new column in a Gridview when there is no record and we want to show a proper message that there is no data against particular search in asp.net using c#. see the below code and copy and p…

how to concatenate Strings in asp.net using C#

In this web programming tutorial we will learn that how we can concatenate strings in asp.net using c#. just copy and paste the below code. string practice = "Adress1" + "," Karachi ", "state" + "4600";…

how to show prompt box using javascript

In this web programming tutorial we will learn that how we can use Javascript Prompt function on our web pages. see the below code and just copy and paste it as it is. Javascript Prompt Box

how to upload photo or picture in asp.net using c#

In this web programming tutorial we will learn that how we can upload a picture or photo in asp.net using c#. just copy and paste below code in you .cs file. protected void btn_upload_Click(object sender, EventArgs e) { imageflag = 1; …

how to Upload Image or file on FTP in Asp.net using c#

In this web programming tutorial we will learn that how we can Upload Image or file on FTP in Asp.net File Uploader using c#. copy the below code in your .cs file. public void ftpfile(string ftpfilepath) { string ftphost = "your domain …

how to disable right click using jquery

In this web programming tutorial we will learn that how we can prevent right click functionality in browser (this code snipit will work in all browsers).

how to generate image button dynamically in asp.net using c#

In this web programming tutorial we will learn that how we can create an image button dynamically in asp.net using c#. see the below code and put it in your .cs file in page load event. protected void Page_Load(object sender, EventArgs e) { …

how to add text to image in asp.net using c#

In this web programming tutorial we will learn that how we can add some text on an image in asp.net using c#.just copy and page the code and add it in your .cs file. using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D…

how to use span tag on a web page using html

In this web programming tutorial we will learn about span tag by using it on a web page using html. span tag is used to provide an additional structure to an html document. It is used to group and apply style sheet to inline elements of a web page…

how to use div tag on a web page using html

In this web programming tutorial we will learn that how we can use div tag in an html document or in a web page. div tag is normally used to define a section in an html document or in a web page div tag is a pair tag and must be used a closing tag i…

how to use font tag in html

In this web programming tutorial we will learn that how we can use font tag in an html document or in a web page. this text is with Verdana font this text is with arial font this text is with helvitica font this text is with impact font …

how to use different format text in html

In this web programming tutorial we will learn that how we can use different type of text format in an web page or in an html document. see the below code. here is the code to make text bold in order to make text bold output: in order to make t…

how to use line break tag using html

In this web programming tutorial we will learn that how we can use Line Break tag  in an html document tag. Line breaks are used to decide where the text will break on a line or continue to the end of the window. it can be used to move the control t…

how to use paragraph tag in html

in this web programming tutorial we will learn that how we can use paragraph tag in an html document or in a web page. paragraph tag are used in a document to add text in such a way that it will automatically adjust the end of line to suit the windo…

how to use heading tag in html

in this web programming tutorial we will learn that how we can use heading tag heading in a html page. headings are very important part of any web page. it is used to display different type of heading in HTML document heading tag is a pair tag, …

how to create basic html page

in this web programming tutorial we will learn that how we can create a basic html page. just copy and paste the below code in any editor such as note pad and save the file as test.html. just double click to run the page. my first page …

How to generate random numbers in asp.net using c#

in this we programming tutorial we will learn that how we can create random number in asp.net using c#. see the below code and just copy and paste. Random rand = new Random((int)DateTime.Now.Ticks); int numIterations = 0; numIteratio…

how to re-write url in asp.net using c#

In this web programming tutorial we will learn that how we can re-write url in asp.net, as it is very important and common and most difficult task for an asp.net developer to re-write url. For URL Rewriting we are using URLRewriter.Net which is ava…

how to Send Email from Gmail in asp.net using c#

In this web programming tutorial we will learn that how we can send email from Gmail in asp.net using c#, see the below code and just copy and paste. protected void btnSendEmail_Click(object sender, EventArgs e) { //Create Mail Message Object wi…

How to enable/disable dropdownlist combobox through a checkbox selection in asp.net using jquery

In this web programming tutorial we will learn that how we can enable/disable dropdownlist control through checkbox selection in asp.net.�������������������������������������������������������������������������������������������������������������…

How to Add copy to clipboard button on page

In this web programming tutorial we will learn how to add or PUT add copy to clip board button functionality on your html or asp.net page copy the below code in your html page. Enter Text And Click Button To Copy Text To ClipBoard��������…

how to get IP address of visitor using php

In this web programming tutorial we will learn that how we can get or track real (orignal) IP address of visitor of our page. return !empty($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : (!empty($_SERVER['HTTP_X_FO…

how to generate barcode in asp.net using c#

In this web programming tutorial we will learn that how we can generate barcode in asp.net using c#, as it is often used in different projects and web developers have to face problem, see the below code and just copy and past in your page. Code for …

how to Writing a Text Files Line Counter in asp.net using c#

In this web programming tutorial we will learn that how we can Writing a Text Files Line Counter in asp.net using c#, Bellow is the code, it's so simple that I'm lazy to explain, enjoy: DirectoryInfo dInfo = new DirectoryInfo(args[0]); F…

what is a static member of the Class in asp.net using c#

Static Members One of the tricks about .NET classes is that you really use them in two ways. You can use some class members without creating an object first. These are called static members, and they’re accessed by class name.

Foreach loop in asp.net using C#

In this web programming we will learn the use of foreach loop in C#. a foreach loop allows you to loop through the items in a set of data. With a foreach loop, you don’t need to create an explicit counter variable. Instead, you create a variable …

Inner Join in sql quey

In this web programming tutorial we will learn that how we can write sql query for Inner join see the below inner join query, SELECT * FROM Products INNER JOIN Suppliers ON Products.SupplierID = Suppliers.SupplierID

How to use IF Else Condition to show hide div using Jquery

In this Web Programming tutorial we will learn that how we can use IF and ELSE Condition in Jquery to show or Hide an element on a web form. below is the code: HTML Button Code: Below code will check if Div element is hidden than it will mak…

how to hide div on button click using jquery

In this JQuery web programming tutorial we will learn that how we can hide an element on a page using jquery. in this example we will learn that by clicking on a button how we can hide div or any element using jquery. HTML button JQuery Code $(…

how to add or replace css class on using jquery

In this web Programming tutorial we will learn that how we can replace or Add a css Class to take effect on a specific table's row using jquery, Css Class we want to replace .test { background-color: #dddddd; color: #666666; } Jquery Code to…

how to change Row back ground color and text color using jquery

In this web programming tutorial we will learn that how we can change the background color and text color of Table's alternate rows ie we want that Every "Even" Row's text color and background color of a table should changed using J…

how to reverse a string in asp.net using c#

In this web Programming tutorial we will learn that how we can print a string in reverse mode in asp.net using c#, for example you have a string as below string a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; and you want to print or show it in Rever…

how to create image button dynamically in asp.net using c#

In this web programming tutorial we will learn that how we can creat a image button dynamically in asp.net using c#. See the below code for your .cs file in my case i have created a print button you may create a button as per your requirements. I…

how to format amount (Moany) in asp.net using c#

In this web Programming tutorial we will learn that how we can format a string to Monay type. see the below code in asp.net using c#. Code for .cs file Total_amount.Text = string.Format("{0:###,###,##0.00}", Total_Amountdue);

what is LINQ

LINQ (Language Integrated Query) is a set of extensions for the C# and Visual Basic languages. It allows you to write C# or Visual Basic code that manipulates in-memory data in much the same way you query a database. Technically, LINQ defines about…

how to save and fetch images from sql server in asp.net using c#

in previous article we explained that how to save files in sql server database using asp.net now we will learn that how to fetch images from sql server database in asp.net using c# below function in page load event will just fetch the image data fro…

how to convert text string into an image in asp.net using c#

in this web programming tutorial we will learn that how we can convert text string provided by user into an image in asp.net using c#. this will help us to make our own captcha images instead to use third party tools. HTML Code to get text string fr…

how to export data into excel file from grid view in asp.net using c#

In this web programming tutorial we will learn that how we can export grid view data into a pdf file in asp.net using c#. For exporting the GridView to PDF I am using the iTextSharp Library. You will need to Add Reference for the iTextSharp Library …

how to export grid view data into MS excel file in asp.net using c#

In this web programming tutorial we will learn that how we can export grid view data into MS excel file in asp.net using c# Code for .cs file protected void btnExportExcel_Click(object sender, EventArgs e) { Response.Clear(); Response.Buffer = true…

how to validate image at client side in asp.net

In this web Programming tutorial we will learn that how we can validate the image at client side before uploading it that it is according to our required format i.e. png, jpg or bmp. Upload a valid image;

how to re size the image while uploading in asp.net using c#

In this web programming tutorial we will learn that how can we resize the image while uploading to the server as per our requirements. code for .cs file using System; using System.Data; using System.Configuration; using System.Web; using Sys…

how to reset all form elements in asp.net using c#

In this web programming tutorial we will learn that how we can reset all web form controls in one click ie (by clicking on reset button) in asp.net using c#. code for .cs file. public static void ResetControls(ControlCollection pagecontrols, bool tx…

Javascript Validation in ASP.net

in this web programming tutorial we will learn that how we can validate asp.net form fields using javascript. See the below function and use it as per your requirements. function validateregform() { if (document.getElementById(" ").value…

how to Export Grid View Data into Excel in asp.net using c#

In this web programming tutorial we will learn that how we can export grid view's Data into an excel sheet in asp.net using c#. protected void BtnExport_Click1(object sender, ImageClickEventArgs e) { string attachment = "attachment; filenam…

how to Read and write text file in asp.net using c#

In this web programming tutorial we will learn that how we can read a text file in asp.net using c# and how we can write some text or data on a text file in asp.net using c#. Reading and writing (File manipulation) is a very easy task in asp.net, in…

how to Disable the text selection and drag and drop

in this web programming tutorial we will learn that how we can disable the drag and drop and text selection facility on our web pages. in order to do so just put the below code in body section of your code: but there is one drawback of the above cod…

how to check all check boxes using jquery

In this web programming tutorial we will learn that how we can check all check boxes in a page using jquery. Reason for Celebrity Famous on the internet Committed a crime Dates a super model Hosts a TV show Big in Japan Check all Jquery Code …

how to redirect page after some time delay in asp.net using c#

In this web programming tutorial you will learn how to redirect user after some time delay in asp.net using c#. Normally people use redirection process after showing some message to their users, for example a message can be "Thank you for visitin…

how to register DLL in asp.net

In this programming tutorial you will learn how to register dll. It is quite easy as you just have to execute a simple command, but before knowing the command you must have Administrator rights over the operating system (Windows). You just have to r…

how to call methods in asp.net using c#

In this web programming tutorial we will learn that how we can call or invoke our methods in asp.net using c#. Invoking your methods is straightforward—you simply type the name of the method, followed by parentheses. If your method returns data, you…

how to declare private method in asp.net using c#

In this web programming tutorial we will learn that how to declare a private method in asp.net using c#. When you declare a method in C#, the first part of the declaration specifies the data type of the return value, and the second part indicates t…

how to declare a method with return type in asp.net using c#

In this web programming tutorial we will learn that how to declare a method with return type in asp.net using c#. When you declare a method in C#, the first part of the declaration specifies the data type of the return value, and the second part ind…

how to declare methods in asp.net using c#

In this web programming tutorial we will learn that how we can declare methods in asp.net using c#. When you declare a method in C#, the first part of the declaration specifies the data type of the return value, and the second part indicates the met…

how to use Do while loop in asp.net using c#

in this web programming tutorial we will learn that how we can use do while loop in asp.net using c#. You can also place the condition at the end of the loop using the do . . . while syntax. In this case, the condition is tested at the end of each pa…

how to use The while loop in asp.net using c#

Finally, C# supports a while loop that tests a specific condition before or after each pass through the loop. When this condition evaluates to false, the loop is exited. int i = 0; while (i

how to use The for Loop in asp.net using c#

In this web programming tutorial we will learn that how we can use The for loop is a basic ingredient in many programs. It allows you to repeat a block of code a set number of times, using a built-in counter. To create a for loop, you need to specif…

how to use The switch Statement in asp.net using c#

In this web programming tutorial we will learn that how we can use switch statement in asp.net using c#. C# also provides a switch statement that you can use to evaluate a single variable or expression for multiple possible values. The only limitati…

how to use if Statement in asp.net using c#

The if statement is the powerhouse of conditional logic, able to evaluate any combination of conditions and deal with multiple and different pieces of data. Here’s an example with an if statement that features two conditions: if (myNumber > 10) { …

Operators in asp.net using C#

in this we programming tutorial we will know the list of operators in asp.net using c# Operator Description == Equal to. != Not equal to. <   Less than. >   Grea…

Load More
That is All