Beans' Place
  Home://      \\ Back              
Programming
Family
Lime Bay

 

© 2002-2010
www.beanland.net.au
 

ASP.NET Controls & Code

This code is written for ASP.NET 2.0 using VB.NET and are tested on IE 7 / Firefox 2.

The controls contain the full source code. You can download them, modify them and use them freely. I do ask you send me any useful modifications and/or comments you think will benefit other people (seeing as you got the code for free).

NOTE: Most of these links open in another window.

Debug Panel (User Control)

Debug Panel is a VB User Control useful for enhancing the ASP.NET trace panel by adding a few missing items such as: A navigation index (which shows only the section you want and hides all other sections); A JavaScript debugger and basic DOM walker; ability to show the debug panel when Trace is disabled in .NET (user specific); and a lot of other useful information. By placing 2 lines of code in your footer/master page this control will be added to the top of the .NET trace panel.
DownloadDemo
Version: 1.35, Mar 2007Screenshot
Documentation
 

Excel file read/write via ADO or OLE classes

ExcelADO is a VB class which allows you to open an Excel file via ADO. The class object includes several easy to use methods to read and write data into an excel file. For more advanced features, the class allows you to manipulate the DataSet (DataTable or DataRow) directly.
ExcelOLE is a VB class which allows you to open an Excel file via OLE Automation (COM). The class object includes several easy to use methods to read and write data into an excel file. For more advanced features, the class allows you to manipulate the Excel Workbook directly.
MS Excel must be installed for these classes to work.
DownloadADO Demo, OLE Demo
Version: 1.03, Nov 2006Screenshot
Documentation
 

HTMLText converter (class)

This code is an ASP.NET (VB) class which converts HTML to Text and Text to HTML while preserving as much formatting a possible. HTML2Text formats links to URLs, unencodes the HTML, removes styles, scripts, and of course HTML tags. Spacing and formatting are also cleaned up. Text2HTML formats URLs to links, observes line feeds, tabs and spacing. It also does HTML encoding. An extra function to detect if HTML tags exist in the text is also included. HTML2TXT, HTM2TXT, TXT2HTML, TXT2HTM, TXT
DownloadDemo
Version: 2.1, Apr 2007
 

ReScroller (Custom Server Control)

This code is an ASP.NET (VB) custom server control to maintain the browser's scroll position after postback. Unlike the .NET/IE SmartNavigation feature, it works with all browsers and does not produce weird quirks.
Download
Version: 1.0, Jan 2006
Documentation
 

Tab Control (Custom Server Control)

This code will create an ASP.NET custom server tab control similar to what you would expect from a Windows application. It allows you to organise areas of your page or pages into tabs and for the user to select the tab to show the information neatly. By copying 1 folder of files to your site and adding a few lines of code to your page, you can have this control up and running in no time. The result is a professional looking, and familiar Windows style tabbed interface. You can also optionally add icons to each tab and set many interface settings. Tested under IE, Mozilla and Firefox. Includes VS2002 & 2005 (.NET 1.1/2.0) solution files.
DownloadDemo
Version: 1.5.2, Feb 2008Screenshot
Documentation
 

SMTP Email parser (Code snippet)

This code is the beginning of an SMTP email parser (there is no native .NET 2.0 class to do this - crazy. You can send them, but not read them). I tried to make this code as compact and as simple as possible - at least in the 1st version! Sorry if my techniques are a bit dodgy - least it works. Anyway, this is where I got up to. It runs and reads encoded emails, but it doesn't read the attachments or decode the QuotedPrintable bits yet, but that can be added fairly easily (framework is there already for this). I abandoned this code (for the time being at least) as I found a better way to read email - the old ClassicASP way. Create a reference to Microsoft CDO for Windows 2000, then you can use the CDO object to do everything - easy.
Download
Version: 0.1, Mar 2007
 

AJAX HTTP Request (Client Side Callbacks for .NET 1.0/1.1)

AJAX (Asynchronous JavaScript and XML) HTTP Requests, (which Microsoft is calling CallBacks in .NET 2.0) is where a piece of JavaScript can call a server side (ASPX) page to obtain a result - without the user knowing (no popup windows). It is used increasingly often in populating the next level in a series of linked drop down lists and progress bars. This code is a fault tolerant JS script file with demo. Works for all recent browsers.
Download
Version: 1.0, May 2005
 
 
This code is also available on Planet Source Code
PayPal
 

Request Details

Session Id:5yn11m453n2vhu55zxln4qzaRequest Type:GET
Time of Request:3/10/2010 2:39:20 PMStatus Code:200
Request Encoding:Unicode (UTF-8)Response Encoding:Unicode (UTF-8)

Trace Information

CategoryMessageFrom First(s)From Last(s)
aspx.pageBegin PreInit
aspx.pageEnd PreInit0.05035268947039390.050353
aspx.pageBegin Init0.0505172221130660.000165
aspx.pageEnd Init0.050592582298830.000075
aspx.pageBegin InitComplete0.05061588854157360.000023
aspx.pageEnd InitComplete0.05064057801196750.000025
aspx.pageBegin PreLoad0.05066291542377420.000022
aspx.pageEnd PreLoad0.05068618308475480.000023
aspx.pageBegin Load0.05072293007055460.000037
aspx.pageEnd Load0.05392612092524780.003203
aspx.pageBegin LoadComplete0.05398716013217830.000061
aspx.pageEnd LoadComplete0.05401105081718320.000024
aspx.pageBegin PreRender0.05403397695811380.000023
aspx.pageEnd PreRender0.05409373725104940.000060
aspx.pageBegin PreRenderComplete0.05416069375725640.000067
aspx.pageEnd PreRenderComplete0.05418521461105650.000025
aspx.pageBegin SaveState0.05849973885862280.004315
aspx.pageEnd SaveState0.07090768384388680.012408
aspx.pageBegin SaveStateComplete0.07097259122979370.000065
aspx.pageEnd SaveStateComplete0.0709969348932750.000024
aspx.pageBegin Render0.07101945521121730.000023
aspx.pageEnd Render0.07606148718406720.005042

Control Tree

Control UniqueIDTypeRender Size Bytes (including children)ViewState Size Bytes (excluding children)ControlState Size Bytes (excluding children)
__PageASP.programming_dotnet_default_aspx1766400
    ctl00ASP.main_master1766400
        ctl00$ctl12System.Web.UI.LiteralControl17100
        ctl00$ctl00System.Web.UI.HtmlControls.HtmlHead78400
            ctl00$ctl13System.Web.UI.LiteralControl9400
            ctl00$genTitleSystem.Web.UI.HtmlControls.HtmlTitle4600
            ctl00$ctl01System.Web.UI.HtmlControls.HtmlMeta6900
            ctl00$ctl02System.Web.UI.HtmlControls.HtmlMeta10400
            ctl00$ctl03System.Web.UI.HtmlControls.HtmlMeta6600
            ctl00$ctl04System.Web.UI.HtmlControls.HtmlMeta4000
            ctl00$ctl05System.Web.UI.HtmlControls.HtmlMeta5100
            ctl00$ctl06System.Web.UI.HtmlControls.HtmlLink5600
            ctl00$ctl07System.Web.UI.HtmlControls.HtmlLink4800
            ctl00$ctl08System.Web.UI.HtmlControls.HtmlLink6100
            ctl00$ctl14System.Web.UI.LiteralControl6600
            ctl00$litPageHeaderSystem.Web.UI.WebControls.Literal701120
        ctl00$ctl15System.Web.UI.LiteralControl1300
        ctl00$divGUISystem.Web.UI.WebControls.Panel203100
            ctl00$ctl16System.Web.UI.ResourceBasedLiteralControl33600
            ctl00$lblPageTitleSystem.Web.UI.WebControls.Label5500
            ctl00$ctl17System.Web.UI.LiteralControl5900
            ctl00$tblTopNavSystem.Web.UI.HtmlControls.HtmlTable136000
                ctl00$ctl09System.Web.UI.HtmlControls.HtmlTableRow121000
                    ctl00$tdHomeSystem.Web.UI.HtmlControls.HtmlTableCell19900
                        ctl00$ctl18System.Web.UI.LiteralControl1400
                        ctl00$hypHomeSystem.Web.UI.WebControls.HyperLink8400
                        ctl00$ctl19System.Web.UI.LiteralControl1200
                    ctl00$tdLine1System.Web.UI.HtmlControls.HtmlTableCell13300
                        ctl00$ctl20System.Web.UI.LiteralControl5900
                    ctl00$tdBackSystem.Web.UI.HtmlControls.HtmlTableCell23000
                        ctl00$ctl21System.Web.UI.LiteralControl2000
                        ctl00$hypBackSystem.Web.UI.WebControls.HyperLink10900
                        ctl00$ctl22System.Web.UI.LiteralControl1200
                    ctl00$tdLine2System.Web.UI.HtmlControls.HtmlTableCell12700
                        ctl00$ctl23System.Web.UI.LiteralControl5900
                    ctl00$tdLogoutSystem.Web.UI.HtmlControls.HtmlTableCell17900
                        ctl00$ctl24System.Web.UI.LiteralControl6400
                        ctl00$lblLoginNameSystem.Web.UI.WebControls.Label37200
                        ctl00$ctl25System.Web.UI.LiteralControl1600
                    ctl00$tdMessageSystem.Web.UI.HtmlControls.HtmlTableCell6900
                        ctl00$ctl26System.Web.UI.LiteralControl600
                    ctl00$ctl10System.Web.UI.HtmlControls.HtmlTableCell11100
                        ctl00$ctl27System.Web.UI.LiteralControl800
                        ctl00$lblDateSystem.Web.UI.WebControls.Label3200
                        ctl00$ctl28System.Web.UI.LiteralControl1200
                    ctl00$ctl11System.Web.UI.HtmlControls.HtmlTableCell11400
                        ctl00$ctl29System.Web.UI.LiteralControl5900
            ctl00$ctl30System.Web.UI.LiteralControl18800
        ctl00$ctl31System.Web.UI.LiteralControl400
        aspnetFormSystem.Web.UI.HtmlControls.HtmlForm1444600
            ctl00$ctl32System.Web.UI.LiteralControl200
            ctl00$LeftNavPaneSystem.Web.UI.WebControls.Panel407700
                ctl00$ctl33System.Web.UI.LiteralControl500
                ctl00$pnlProgHeaderSystem.Web.UI.WebControls.Panel12500
                    ctl00$ctl34System.Web.UI.LiteralControl1300
                ctl00$ctl35System.Web.UI.LiteralControl200
                ctl00$pnlProgContentSystem.Web.UI.WebControls.Panel205900
                    ctl00$ctl36System.Web.UI.ResourceBasedLiteralControl199400
                ctl00$ctl37System.Web.UI.LiteralControl200
                ctl00$pnlFamilyHeaderSystem.Web.UI.WebControls.Panel12400
                    ctl00$ctl38System.Web.UI.LiteralControl800
                ctl00$ctl39System.Web.UI.LiteralControl200
                ctl00$pnlFamilyContentSystem.Web.UI.WebControls.Panel72900
                    ctl00$ctl40System.Web.UI.ResourceBasedLiteralControl66200
                ctl00$ctl41System.Web.UI.LiteralControl200
                ctl00$pnlMiscHeaderSystem.Web.UI.WebControls.Panel12200
                    ctl00$ctl42System.Web.UI.LiteralControl1000
                ctl00$ctl43System.Web.UI.LiteralControl200
                ctl00$pnlMiscContentSystem.Web.UI.WebControls.Panel67200
                    ctl00$ctl44System.Web.UI.ResourceBasedLiteralControl60700
                ctl00$ctl45System.Web.UI.LiteralControl12900
            ctl00$ctl46System.Web.UI.LiteralControl400
            ctl00$LeftNavPaneHeaderSystem.Web.UI.WebControls.Panel18100
                ctl00$ctl47System.Web.UI.LiteralControl1100
            ctl00$ctl48System.Web.UI.LiteralControl400
            ctl00$ContentPaneSystem.Web.UI.WebControls.Panel979300
                ctl00$ctl49System.Web.UI.LiteralControl300
                ctl00$cphMasterSystem.Web.UI.WebControls.ContentPlaceHolder967500
                    ctl00$cphMaster$ctl00System.Web.UI.ResourceBasedLiteralControl967500
                ctl00$ctl50System.Web.UI.LiteralControl200
            ctl00$ctl51System.Web.UI.LiteralControl200
        ctl00$ctl52System.Web.UI.LiteralControl21500

Session State

Session KeyTypeValue

Application State

Application KeyTypeValue

Request Cookies Collection

NameValueSize

Response Cookies Collection

NameValueSize

Headers Collection

NameValue
Cache-Controlno-cache
Connectionclose
Pragmano-cache
Accepttext/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-CharsetISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encodinggzip
Accept-Languageen-us,en;q=0.5
Hostwww.beanland.net.au
User-AgentCCBot/1.0 (+http://www.commoncrawl.org/bot.html)
x-cc-idccc01-02
X-Rewrite-URL/Programming/dotnet/

Response Headers Collection

NameValue
X-AspNet-Version2.0.50727
Cache-Controlprivate
Content-Typetext/html

Form Collection

NameValue

Querystring Collection

NameValue

Server Variables

NameValue
ALL_HTTPHTTP_CACHE_CONTROL:no-cache HTTP_CONNECTION:close HTTP_PRAGMA:no-cache HTTP_ACCEPT:text/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip HTTP_ACCEPT_LANGUAGE:en-us,en;q=0.5 HTTP_HOST:www.beanland.net.au HTTP_USER_AGENT:CCBot/1.0 (+http://www.commoncrawl.org/bot.html) HTTP_X_CC_ID:ccc01-02 HTTP_X_REWRITE_URL:/Programming/dotnet/
ALL_RAWCache-Control: no-cache Connection: close Pragma: no-cache Accept: text/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding: gzip Accept-Language: en-us,en;q=0.5 Host: www.beanland.net.au User-Agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html) x-cc-id: ccc01-02 X-Rewrite-URL: /Programming/dotnet/
APPL_MD_PATH/LM/W3SVC/11039/ROOT
APPL_PHYSICAL_PATHC:\clients\CL696\beanland.net.au\public_html\
AUTH_TYPE 
AUTH_USER 
AUTH_PASSWORD 
LOGON_USER 
REMOTE_USER 
CERT_COOKIE 
CERT_FLAGS 
CERT_ISSUER 
CERT_KEYSIZE 
CERT_SECRETKEYSIZE 
CERT_SERIALNUMBER 
CERT_SERVER_ISSUER 
CERT_SERVER_SUBJECT 
CERT_SUBJECT 
CONTENT_LENGTH0
CONTENT_TYPE 
GATEWAY_INTERFACECGI/1.1
HTTPSoff
HTTPS_KEYSIZE 
HTTPS_SECRETKEYSIZE 
HTTPS_SERVER_ISSUER 
HTTPS_SERVER_SUBJECT 
INSTANCE_ID11039
INSTANCE_META_PATH/LM/W3SVC/11039
LOCAL_ADDR70.84.3.19
PATH_INFO/Programming/dotnet/Default.aspx
PATH_TRANSLATEDC:\clients\CL696\beanland.net.au\public_html\Programming\dotnet\Default.aspx
QUERY_STRING 
REMOTE_ADDR38.107.191.97
REMOTE_HOST38.107.191.97
REMOTE_PORT50803
REQUEST_METHODGET
SCRIPT_NAME/Programming/dotnet/Default.aspx
SERVER_NAMEwww.beanland.net.au
SERVER_PORT80
SERVER_PORT_SECURE0
SERVER_PROTOCOLHTTP/1.1
SERVER_SOFTWAREMicrosoft-IIS/6.0
URL/Programming/dotnet/Default.aspx
HTTP_CACHE_CONTROLno-cache
HTTP_CONNECTIONclose
HTTP_PRAGMAno-cache
HTTP_ACCEPTtext/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSETISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODINGgzip
HTTP_ACCEPT_LANGUAGEen-us,en;q=0.5
HTTP_HOSTwww.beanland.net.au
HTTP_USER_AGENTCCBot/1.0 (+http://www.commoncrawl.org/bot.html)
HTTP_X_CC_IDccc01-02
HTTP_X_REWRITE_URL/Programming/dotnet/

Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082