Posts

Export Html string to word in asp.net

This is a simple blog to demonstrate how to export hmtl string to MS Word. So here i going to create a function with parameter filename and htmlstring. public void downloadAsWord(String filename, String htmlstring)     {         HttpContext.Current.Response.Clear();         HttpContext.Current.Response.ContentType = "application/msword";         HttpContext.Current.Response.ContentEncoding = System.Text.UnicodeEncoding.UTF8;         HttpContext.Current.Response.Charset = "UTF-8";         Response.AddHeader("Content-Disposition", "attachment; filename=" + filename + ".doc");         Response.Write("<html>");         Response.Write("<head>");         Response.Write("<META HTTP-EQUIV=Content-Type CONTENT=text/html charset=UTF-8>");         Response.Write("...

How to Capture image of HTML5 camera in asp.net

Image
In this blog I am going to capture image of HTML5 camera and store in a file using asp.net Step 1. Open Visual Studio  =>  File => new => website Step 2. Give the name of application Step 3. Add New Page Step 4. Add  Jquery min js link inside head tag  <script src="https://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script> Html Markup and script <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Capture.aspx.cs" Inherits="Capture" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title>HTML5 Camera  </title>     <style type="text/css">         .style1         {             width: 600px;         ...

How to create google organization chart from database in Asp.net

Image
In this article I am going to explain how to create google organization chart from database in ASP.NET. Step by step Step 1  Create Database and table in sql server Table Design Column DataType Id Int Name Varchar(50) Parent Varchar(50) ToolTip Varchar(50) Sample Data Name Parent Tooltip Manager Manager Supervisor1 Manager Supervisor1 Supervisor2 Manager Supervisor2 Supervisor3 Manager Supervisor3 Employee1 Supervisor1 Employee1 Employee2 Supervisor1 Employee2 Employee23 Supervisor2 Employee3 Step 2 Open visual studio => Create new website => Add new page and give the suitable name Step 3 Html Markup <% @ Page Language ="C#" AutoEventWireup ="true" CodeFile ="Chart.aspx.cs" Inherits ="Ch...

Upload Drag Drop file to the server in asp.net using ajax and handler

Image
In this article i am going to demonstrate how to upload , drag and drop file in asp.net. here i am using ajax and handler to upload drop file to the server. Step 1   Open visual studio create a website and give the suitable name. Step 2 Add new web form Step 3 Put below script on the head of page < script src ="//code.jquery.com/jquery-1.12.0.min.js"></ script >     < script >         $(document).ready( function () {             var Divobj = $( "#drgdiv" );             Divobj.on( 'dragenter' , function (e) {                 $( this ).css( 'border' , '1px solid green' );                 e.stopPropagation();   ...