Posts

Export div content to PDF Using ITextSharp in asp.net

Image
In this short article I will explain how to export content in a div to a PDF using ITextSharp  in ASP.Net. Step1: ITextSharp is a free and open source assembly that helps to convert page output or HTML content in a PDF file.Download it first from given link  and add dll file in bin folder- https://sourceforge.net/projects/itextsharp/files/itextsharp/ Step2 -add Page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Studentdetails.aspx.cs" Inherits="Studentdetails" EnableEventValidation = "false" %> <!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></title> </head> <body>     <form id="form1" runat="server">   <div id="studentdetails" runat=...

Bootstrap Modal Popup keep open on PostBack in ASP.Net

In This tutorial will show you how keep open Bootstrap Modal Popup when Postback in asp.net I have added one button inside  bootstrap model. in some requirement we need to save data and get some output on popup after button click in model popup . source code- <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div class="container"> <div class="row"> <h1> Hello, world! Hello, world!</h1> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min....

How to Send Email with Attachment using ASP.NET with c#

This tutorial will show you how to send a simple email message with an attachment using ASP.NET with C# Sending a email with an attachment using ASP.NET is actually very simple.First, you will need to import the System.Net.Mail namespace.The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email and the message attachment. aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title> </head> <body>     <form id="form1" runat="server">     <div>     <table  >     <tr>         <td style="width: 80px">             To:         </td>         ...

Dynamic Mega Menu With Asp.Net with c#,java script and Sql Server.

Image
Introduction: In this article you’ll see how to Create dynamic  Mega Menu in asp.net .Having a menu and sub menus with links is very normal in a Web application. Typically, we create static menu and menu items. But sometimes we need dynamic mega menu when we do not know what the menu names and links will be called. Mega menus are a growing trend in web design . For sites that involve a lot of pages and/or products, a mega menu may be able to improve navigation and usability. Dynamic Mega Menu with ASP.NET, C#, jQuery and SQL Server solution that I would like to share with others puzzled with the same as was one of my website development i was having a tough time creating a Mega menu from database. Step1  Database:  I have 4 table category,subcategory  subcategory2 and  Brand  GO /****** Object:  Table [dbo].[tbl_Category]    Script Date: 07/30/2015 08:03:43 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON ...

how to Repeater update only when table rows updated in sql using SqlCacheDependency in ASP.Net?

Advantage -repeater/Gridview/Datalist do not load every time from database ,it load when any change or add in database . In this article, we are going to learn how to implement SQL Caching in ASP.NET using Poll based SQL Cache dependency SQL Cache dependency helps to cache tables in ASP.NET application in memory. So rather than making SQL server trips we can fetch the data from the cached object from ASP.NET. Step- 1 ALTER DATABASE MyDatabase SET ENABLE_BROKER Step- 2  aspx Page <asp:Repeater ID="RepDetails" runat="server">     <ItemTemplate>         <asp:Label ID="lblid" runat="server" Text='<%#Eval("Cat_Id") %>' Font-Bold="true"             Visible="false" />         <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("Cat_Name") %>' ForeColor="Green"></asp:LinkButton>     </I...

how to add/change css for MultiHandleSliderExtender

Image
In this Article i will explian how to add css for MultiHandleSliderExtender step1-add ajaxtoolkit manager in page.    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager> step2-add  MultiHandleSliderExtender in page. <div>      <asp:TextBox ID="txtfrom" runat="server" Width="70" Text="0"></asp:TextBox>         <asp:TextBox ID="txtto" runat="server" Width="70" Text="200"></asp:TextBox>         <br /><br />         <asp:MultiHandleSliderExtender ID="MultiHandleSliderExtender1" ShowHandleDragStyle="true" runat="server"  BehaviorID="multiHandleSliderExtenderTwo"             ShowInnerRail="true" HandleAnimationDuration="0.1" TooltipText="{0}" TargetControlID="slider" InnerRailStyle="SlidingDoors...