27 Reusable Code Snippet Topics
Remove Filter
|
|
Write a program using for loops to produce an R by C rectangle, where R and C are provided by the user. The following are the triangles for different values of R and C. R is the number of rows and C is the number of columns |
|
Demonstrates using .NET Remoting to broadcast to client subscribers. There are three parts: 1) Server.cs - for console app responsible for broadcasting messages (date/time stamp currently) 2) Client.cs - for console app that registers with server to subscribe to broadcasts 3) Agent.cs - class library that facilitates/eposes the interfaces for … |
|
This is a very simple login form. I set it up so that the form won't close until it's cancelled or a valid username and password are entered. I chained the check for the username and the check for the password, so that if the username doesn't pass the password … |
|
By means of Mates8, graph coding becomes a bit easier. The web page has four textboxes so the figure gets bounded to the left, right, top and bottom; and a draw button. Additionally, a panel control will contain the image generated by the code after the button is pressed. |
|
This simple but extremely useful trick explains how to hande a radiobutton within an ASP.NET gridview, without having to fiddle around with the sometimes cumbersome beast that javascript is. To avoid postbacks, we'll be using ASP.NET AJAX's updatepanel. Basically, the logic is grabbing the sender (ie, the radiobutton checked), disabling … |
|
[CODE]<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckCode.aspx.cs" Inherits="CheckCode" %> <!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>Verification code to prevent auto signup in ASP.NET 2.0</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a:link { color: #0000FF; } a:visited { … |
|
The days when the calculator had almost 3 thousand visits a day have gone. Since then, there have been several major versions and lots of minor versions. Somehow, I feel pleased in that the present core algorithm follows the rules of the first I read; of course, extending the simplicity … |
|
Here's a simple wrapper for printing text. Built as a class library, this can be used in any .net application. This has automatic word wrapping. I figured that using the new constructor to accept different parameters would easily allow for printing different documents with different settings. I included Name, Font, … |
|
This snippet will allow you to easily work with session variables in your applications. This example is using a string type but it works the same for any data type, you would just need to change the default return value from string.Empty to something more appropriate. |
|
In a recent discussion these code snippets were developed to replace Convert.ToInt32 and Convert.ToDouble. The person I was helping had a very large number of conversions to do. In our tests, using these 2 routines we were able to do over 1 million conversions in less than half the time. … |
|
All the webpage data will be converted into PDF file, You can also add details such as ur name etc by using Chunk chunk1 = new Chunk("By Vishal RAne, [email]vishalrane50@example.com[/email] \n",FontFactory.GetFont("Verdana", 8)); The pdf will be saved on desktop.... u can change location by using PdfWriter.GetInstance(Doc, new FileStream(Environment.GetFolderPath (Environment.SpecialFolder.Desktop)+ "\\VishalRane.pdf", … |
|
here is my code i want update the two fields without refreshing whole page.... |
|
Hi, This code checks the availability of username from the database. |
|
To make some operations on XML elements you have to know their types. This snippet is about getting the types of these elements. |
|
Hello everyone. i have a student database, from which i search a student by entering the student ID at the web interface.Im using a repeater to display search results. Within this repeater i have a link button that should redirect to a page that will display full information about the … |
|
Hi I thought I'd share this with you all as it is really quite simple but I spent ages looking for it. I have an ASP.Net App with a master page containing a tree view that holds a heirarchy of data (as opposed to site naviagation) What I wanted was … |
|
Hello. This demo shows how to upload multiple image files, saving them in "Image" folder and displaying them all. To do this, create a folder named "Image" in your solution explorer. I hope you like it :) |
|
hey buddies:) here is login page for begining purpose in asp.net i hope you will enjoy it and it is expected there is some mistakes also so please feedback it. Thanks |
|
Hello friends, I wrote a simple class for string validation and now I want to share with you. The class contains: - Constructor(s) public Validator() public Validator(string text) - Properties private string strText = string.Empty; - Method(s) public bool isNullOrEmpty() public bool isNullOrEmpty(string str) public bool isLengthMax(int maxLength) public bool … |
|
1. Imports System.IO 2. Create class "CreateThumbnails" or any class and place following function inside that class You need one function to response call back to main function Function ImageAbortDummyCallback() As Boolean Return False End Function |
|
Hello sir, I tried with this code it is running well but I am not getting mail in my account with this code, even this code is not giving any error. Is there any problem?? Please help me. |
|
If you want to restrict the user to go back or forward from the web browser, you can use the below mentioned javascript. Use this javascript in the script tag. It works on all browsers. For further details: [url]http://dotnetbypulikesi.blogspot.com[/url] |
|
Quite a few people have been asking how they can get their applications to talk to each other. More specifically, they have been wanting to know how to access information from another running application using .NET Remoting. Not having done this before, I decided to take up the challenge and … |
|
Sometimes you might need to have checkboxes for each row in a GridView control (like Inbox in Gmail). This code snippet helps to select/unselect all checkboxes in the GridView control by clicking the header checkbox. The selectUnselectCheckboxes() javascript function handles this fuctionality. This function is called in the CheckBox in … |
|
Uploading a file to a specific folder inside the virtual directory. |
|
aspnet_regsql is a tool user for installing membership, role and personalization tables to Sql Server. 1. Porting all tables to Sql Server 2. Porting only membership tables to Sql Server 3. Removing all membership and role tables 4. Removing Personalization tables. I am be posting a detailed blog on Membership … |
|
Web site Administration Tool is accessible only from the hosting server. Many times programmers won't have direct access to the the hosting server. So knowledge of ASP.Net Membership classes is an added advantage in creating an administrative module for the site. In this code snippet we will take up: 1. … |
The End.