Category : Uncategorized

Home » Archive by category : Uncategorized

Disable Right Click on All Images <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Disable right click on images on asp.net web page using jQuery</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> $(function () { $('img').on("contextmenu", function () { return false; }); }); </script> </head> <body> <form id="form1" runat="server"> <div> <img src="http://c.saavncdn.com/801/Kick-Hindi-2014-500×500.jpg" /> <br /> This is dummy text<br /> This is ..

Read more

<%@ WebHandler Language="C#" Class="Handler" %> using System; using System.Web; using System.Web.SessionState; public class Handler : IHttpHandler , IReadOnlySessionState , IRequiresSessionState { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Write("Hello World"); } public bool IsReusable { get { return false; } ..

Read more

PHP sample project: Bus Ticket Reservation with Dynamic forms code PROJECT DETAILS: Title: Bus Ticket Reservation Domain: Web technology Language: PHP scripting, HTML Category: PHP mini projects This simple project has basic HTML forms with dynamic functionality using PHP. There is a JavaScript code for simple form validation. This source code can allow users to ..

Read more

Step 1: Create a div element like below:- <div id="twitter_feed" runat="server"></div> Step 2: Add the following method:- using System.Text.RegularExpressions; using System.Runtime.Serialization.Json; using System.Web.Script.Serialization; using System.Net; using System.Security.Cryptography; using System.Globalization; // use this in your page_load method or anywhere… //twitter_feed.InnerHtml = GetTwitterFeeds(); // unique request public static string GetTwitterFeeds() { var oauth_token = "xxxxxxTOKEN-FROM-TWITTER-xxxxxxx"; var oauth_token_secret ..

Read more

Step 1:  Add the below namespave on the top of the code behind of web page using System.Net; Step 2 : You can call the below method to View Pdf on browser using asp.net:- public void viewebook(string pdf_filepath) { string FilePath = Server.MapPath(pdf_filepath); WebClient User = new WebClient(); Byte[] FileBuffer = User.DownloadData(FilePath); if (FileBuffer != ..

Read more

 How to append hyperlink to Body tag using jQuery? <html> <head> <title></title> </head> <body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> jQuery('<a>http://sourcecodehub.com/</a>').attr('href', 'http://www.sourcecodehub.com').appendTo('body'); </script> </body> &lt..

Read more

Disable Right click on Browser using JQuery <html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $(document).bind("contextmenu", function (e) { alert('Right click is disabled'); e.preventDefault(); //or return false; // }); }); </script> </head> <body> </body> &lt..

Read more

jQuery UI Tabs Widget Example or Creating Content Tabs with jQuery UI <html> <head> <title></title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/base/jquery-ui.css" type="text/css" media="all" /> <script type="text/javascript"> $(function() { $("#tabs").tabs(); }); </script> </head> <body> <div id="tabs"> <ul> <li><a href="#tabs-1">Tab 1</a></li> <li><a href="#tabs-2">Tab 2</a></li> <li><a href="#tabs-3">Tab 3</a></li> </ul> <div id="tabs-1"> <p> www.sourcecodehub.com </p> </div> ..

Read more

 EMail Validation using jQuery with Regular Expression | How to do EMail validation using jQuery <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <title></title> <script type="text/javascript"> $(document).ready(function () { $('#btnSubmit').click(function () { var inputEmail = $("#txtEmail").val(); var emailRegularExpression = /^(^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*)@[0-9a-zA-Z]+([_.-]?[0-9a-zA-Z])*.[a-zA-Z]{2,4})+$/; if (!emailRegularExpression.test(inputEmail)) { $('#ErrorMessage').html('Invalid Email Address'); } }); }); </script> </head> <body> <input type="text" id="txtEmail" /> ..

Read more