Category : ASP.NET Snippets

Home » Archive by category : ASP.NET Snippets

Java Script – Call a Server Side Method in ASP.NET C Sharp with example Below is Default.aspx code: <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %> <!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>Java Script: Calling Server Side Method</title>     <scripttype=”text/javascript”language=”javascript”>         function jsCallServerSideMethod() {       ..

Read more

Use Stored Procedure in ASP.NET with example Step 1: Create a Stored Procedure in MS-SQL Server CREATE PROCEDURE usp_GetAllRecords          AS BEGIN             – SET NOCOUNT ON added to prevent extra result sets from             – interfering with SELECT statements.         ..

Read more

Step 1: Add the itextsharp Dll from this link sourceforge.net/projects/itextsharp/ Step 2: Add the following codes:- Default.aspx <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %> <!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>Create PDF  Page</title> </head> <body>     <formid=”form1″runat=”server”>     <div>         <tablecellpadding=”4″cellspacing=”4″width=”60%”align=”center”border=”2″style=”border-color: Blue;”>         ..

Read more

Some people object to the following method but its one that no one has answered with and I feel that it should be shown as an option. It can be handy when used properly. <%if(ShowLabel){%> <label>This will not be shown if the ShowLabel property evaluates false</label><%}%> To make this work you would have a public ..

Read more