|
|
|
| Window Close Event of Browser |
Window Close Event of Browser (tested with IE9, Chrome, FF 5.0)
javascript <--script language="javascript" type="text/javascript"> var isClose = false; document.onkeydown = checkKeycode function checkKeycode(e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; if (keycode == 116) { isClose = true; } } function somefunction() { isClose = true; } function doUnload() { if (!isClose) { alert('window is closing'); } } <--/script>
call the doUnload() function on the body tag onbeforeunload="doUnload()" |
| Posted by Nilanka Abeysinghe @ 7/19/2011 5:00:00 AM |
|
| IE 9 crashed when open it |
| Error : “Internet Explorer has stopped working." and automatically closed the Internet Explorer
Solution : - Go to Start -> Programs –> Accessories –> Systems Tools.
- Click Internet Explorer (No add-ons) and disable all incompatible add-ons
- Go to Internet Options -> Advanced and Use Software Rendering Instead option
|
| Posted by Nilanka Abeysinghe @ 6/14/2011 5:27:00 AM |
|
| Runtime error, after implementing the paging on ASP.Net grid view |
| I had this issue, after implementing the paging (not the database level paging) for ASP .Net data grid.
Error Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031
Reason for this issue is limitation of maxRequestLength on httpRuntime, as default it’s 4MB (4096 Kb) my dataset returns more than 4096Kb, this error is occurring.
Solution I have increased the httpRuntime maxRequestLength size in web config file applying this tag
< httpRuntime maxrequestlength="8192" / >
|
| Posted by Nilanka Abeysinghe @ 1/14/2011 2:41:00 AM |
|
| Split a Web Application into Multiple Projects |
| In this cases, you may want to divide your Web application into multiple projects within the same solution to facilitate team development. For example, if you have separate teams responsible for different aspects of the same Web application, it is useful to be able to divide the application into multiple projects. This capability is not supported natively by Visual Studio .NET, but it can be achieved with some manual manipulation of virtual roots.
Create an ASP.NET Application from Multiple Projects Create the main project in a directory that is the root directory for the whole application. Create the child projects in subdirectories of the root directory in the same Visual Studio .NET solution. Remove the Web applications that Visual Studio .NET creates for the child projects through IIS.
NOTE: Because Visual Studio .NET does not allow you to create or to work with multiple Web applications in the same physical directory, you must create the various projects that make up your application in separate directories. To deploy the projects to individual development computers, copy the application directory structure to those computers, and then create an IIS application root directory for the main project directory.
Create the IIS Application Root Project Start Visual Studio .NET. On the File menu, point to New, and then click Project. In the New Project dialog box, click the language that you want to use under Project Types, and then click ASP.NET Web Application under Templates. In the Location text box, replace the WebApplication# default name with MainWeb. If you are using the local server, you can leave the server name as http://localhost. The Location box should then appear as follows:
Create the Child Projects For each child project, right-click the solution in the Solution Explorer window, point to Add, and then click New Project. In the Add New Project dialog box, click ASP.NET Web Application under Templates. In the Location text box, type http://localhost/MainWeb/. This creates a child project named in a subdirectory of the root application directory. Delete any files that are not needed for a non-application root directory from the project. Specifically, delete the Global.asax and the Web.config files. This child project will rely on the Global.asax and the Web.config files from the main project. If the child project will only contain shared resources, such as user controls, delete the WebForm1.aspx file.
Remove the IIS Applications That Correspond to the Child Projects To remove the IIS applications that correspond to the child projects, follow these steps: Click Start, point to Programs (or All Programs in Windows XP), point to Administrative Tools, and then click Internet Services Manager. Locate your main Web application and the child Web projects that you want to remove. For each child project, right-click the Web application node, and then click Properties. On the Directory tab, click Remove, and then click OK.
Set References to the Child Projects In Solution Explorer of the main Web application, right-click References, and then click Add Reference. In the Add Reference dialog box, click the Projects tab. Select the child projects, and then click OK.
|
| Posted by Nilanka Abeysinghe @ 8/29/2010 12:05:00 AM |
|
| SMTP server response: 550 5.7.1 Unable to relay |
Error : SMTP server response: 550 5.7.1 Unable to relay
Solution : - Go to: start > settings > control panel > Administrative Tools > Internet Information Services
- Expand the " (local computer)" node
- Right click on your SMTP server and go to "Properties"
- Click "Access" tab
- Under Relay Restrictions, click the "Relay" button
- Click Add and Select "Single Computer" and enter IP address 127.0.0.1
|
| Posted by Nilanka Abeysinghe @ 7/3/2010 6:44:00 PM |
|
| The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) |
I got this error, when i try to start Default Web Site on IIS
Error : The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
Solution Reason for this issue is conflit of the port. Normaly IIS renning on port 80, if that post is beging used by another application, this error is occurring
In my case Skype used the port 80. I have change the incomming connection port on Skype and resolved the issue. |
| Posted by Nilanka Abeysinghe @ 7/3/2010 10:05:00 AM |
|
| error MSB3323: Unable to find manifest signing certificate in the certificate store |
| I got this problem on compiling my C# project, after reinstalling VS2008.
Error : error MSB3323: Unable to find manifest signing certificate in the certificate store
Solution : 1 Go to project properties -> Signing tab -> uncheck the Sign the ClickOnce manifests and Save it
Solution : 2 Open the (.csproj) project file in notepad and find the element and set the value to false and save the project file.
|
| Posted by Nilanka Abeysinghe @ 6/2/2010 9:41:00 AM |
|
| Enable IIS to run 32-bit ASP.NET applications on 64-bit Windows |
if you want to run 32 bit ASP.Net on windows 64bit version, you have to enable ASP.Net 32 bit version. You can do that using folowing commands - Open a command prompt and go to the %systemdrive%\Inetpub\AdminScripts directory
- Type the following command and press enter
cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true
Note: IIS cannot run 32-bit and 64-bit applications concurrently on the same server.
You can’t install SQL server 2005 reporting server without enabling ASP.Net 32bit. You can resolved that type of issues using above command.
|
| Posted by Nilanka Abeysinghe @ 5/30/2010 4:45:00 AM |
|
| SQL 2005 instlation Failure on MSXML6 Installer Error |
Error : "Installation of MSXML 6.0 Parser failed because a higher version is already exits on the machine. To proceed, uninstall the higher version and then run MSXML 6.0 Parser Setup again." - Open regedit from "Start->Run"
- Find a folder similar to Hkey_local_machine\software\classes\installer\products\5A6FB34A0F5DAAA4FB1456990536CE44
- Select it and check the keys inside it to confirm it is the MSXML6 parser key
- Delete this key
Then rerun the SQL server installation. Note : better if you can get the backup of that registry key
|
| Posted by Nilanka Abeysinghe @ 5/26/2010 5:43:00 AM |
|
| How to load windows form dynamically |
| I had to done this in one of my project which is generating user menu dynamically according to database values. In my case I was generated tree view by values stored in database (menu name and assembly name). When the user click on the menu item in tree view, I want to load my Windows forms
When I was lording my windows form, I had faced this issue. main issue I face on here, I'm retrieving string value from database and wanted to call windows from object. As a solution I have use reflection get the object type and create an object using system activator class and import reflection in .Net framework I was used C# .Net for this project
Type type = Type.GetType("name space." + “form assembly name”); Form obj = (Form)Activator.CreateInstance(type); obj.MdiParent = this; obj.Show();
|
| Posted by Nilanka Abeysinghe @ 5/13/2010 7:06:00 AM |
|
| Activate Visual Studio 2008 in Windows 7 |
Normally we can activate Visual Studio 2008 in maintenance mode with following steps- Go to control panel
- Open Add/Remove program
- Select Microsoft Visual Studio 2008
- Click change button
- Enter serial number
- And click Update button
But in the Windows 7, there is no way to enter serial number in VS 2008 maintenance mode (I had this issue on Windows 7 x64 bit version)
After some investigation I found this solution - Extract ISO image to local hard disk
- Then go to "Setup" folder, and open “setup.sdb" file using note pad.
- Search for [Product key] line and change the serial number with yours and save it
Now you can run the setup and reinstall the Visual Studio 2008. |
| Posted by Nilanka Abeysinghe @ 5/4/2010 8:50:00 AM |
|
| How to change the SQL Server instance name |
When you change the name of the computer that is running SQL Server, we have to update system metadata that is stored in sys.servers. You can use following procedures to change the SQL server name and SQL server instance.
Rename server host name (default instance of SQL Server)
sp_dropserver "old_name" sp_addserver "new_name", local
Rename server host name with instance
sp_dropserver "old_name\instancename" sp_addserver "new_name\instancename", local
After run those procedures, you have to reset the SQL instance You can verify SQL server instance name by running this @@SERVERNAME global variable
SELECT @@SERVERNAME |
| Posted by Nilanka Abeysinghe @ 4/27/2010 2:56:00 AM |
|
| Google Wave |
| Google Wave is a new tool for communication and collaboration on the web, coming later this year. Watch the demo video below, sign up for updates and learn more about how to develop with Google Wave. http://wave.google.com/ |
| Posted by Nilanka Abeysinghe @ 6/4/2009 12:45:00 AM |
|
| How to Remove Active Desktop in Windows XP |
- To open the registry editor,
- go to "Start, Run", type regedit and hit “Enter key”
- Find the entry "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
- then create the DWORD values ForceActiveDesktopOn and NoActiveDesktop
- you can do this , right-click into the right-hand window and select "New, DWORD".
- and change the binary value of the registry key called "ForceActiveDesktopOn" to 0 and that of "NoActiveDesktop" to 1
- Quit from the registry edit program and restart your computer.
|
| Posted by Nilanka Abeysinghe @ 5/24/2009 10:36:00 AM |
|
| Rounded corner DIV using CSS (without image) |
In this sample code, we can create a rounded corner DIV without using any images. Just copy and paste CSS code in your CSS file and use the HTML DIV tag code in the HTML page. You can include your content in the content area. CSS code
.containerHeader { background: #DDE5F0; color: black; margin:10px; } .rtop, .rbottom{display:block; background:#fff;}
.rtop *, .rbottom * {display: block; height: 1px; overflow: hidden;
background:#DDE5F0} .r1{margin: 0 5px} .r2{margin: 0 3px} .r3{margin: 0 2px} .r4{margin: 0 1px; height: 2px} HTML Code
Moer refarence, visit the folowing link http://webdesign.about.com/od/css/a/aa072406.htm |
| Posted by Nilanka Abeysinghe @ 9/8/2008 12:35:00 AM |
|
| How to fixed the Google Chrome “The application failed to initialize properly (0xc0000005)” issue |
1. Open the registry by entering “regedit” from a run prompt 2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysPlant. 3. Open the Start DWORD. 4. Change the value to 4 to disable the drivers. 5. Reboot the system to commit the changes.
http://code.google.com/p/chromium/issues/detail?id=38 |
| Posted by Nilanka Abeysinghe @ 9/4/2008 9:40:00 PM |
|
| Master Pin Code For Most Satellite Receivers (STB) |
Locked out of your receiver? Try these PIN codes:
Acc..........................: 0786 Akai.........................: 9009 Amstrad SilverLine...........: 3472 Amstrad CromLine.............: 0000 Ariza........................: 0786 Asterix/Digibox..............: 8175 Astra 3472...................: 6789, 9876 Astrovox.....................: 1668, 1010 Aztech ......................: 1004, 1111 Amstrad Silverline...........: 3472 Amstrad Cromline.............: 0000 Baff.........................: 2142 Baftec 8008 Dragon...........: 1668 Benjamin.....................: 1004, 1250 Besat........................: 8175 Bluejay......................: 3742 Botek........................: 5183 Botech 2000-2001 ci..........: 4200 Citizen......................: 7604 Coolsat......................: 0103 Daewoo.......................: 8503 Digimaster 4100 FTA..........: 2606 Digimaster 4200 FTA..........: 2606 Digimaster 4300 CI...........: 2606 Digimaster 4400 CIP..........: 2606 Digital and QMax.............: 0325, 0867, 0876 Digital Telecom..............: 0851, 1004, 3472 Digitel......................: 0867, 0786 Dizipia......................: 2142 Druck........................: 1324, 1424, 1524, 1624 DV...........................: 8503 DWay.........................: 8503 Echostar.....................: 7604, 2441, 3604 EchoStar.....................: 3453 EchoStar 2200-1200...........: 7604 EchoStar 2110................: 3453 Emtech/Jesspen...............: Menu, Installation OK, STB, OK, 9876 Euromax Em 5000/7000CI.......: 2142 Eurostar.....................: 9999 Euro Star....................: 9949 EuroStar / UroBox............: Menu Key, Enter 9999 And OK. Press 0000 And OK. Now Changed To 0000. Fortec Star 5100PLUS.........: 1010, 1668, 1002, 1111 Fortec Star LiFETIME.........: 1010, 1012, 9966, 6699, 0000 FOrtec Star..................: 1002, 2228, 2002, 2004 Fortec Star 6000.............: 1002 Fortecstar Oneworld..........: 0914 Galaxis......................: 9949 Galaxy.......................: 9949 Golden Interstar.............: 2142 Goldmaster SAT-60100.........: 3453 Goldmaster SAT-60500.........: 3453 Goldmaster SAT-70500.........: 3453 Goldmaster SAT-70700.........: 3453 Goldmaster SAT-80100.........: 3453 Goldmaster SAT-80300.........: 3453 Goldmaster SAT-80500.........: 3453 Goldmaster SAT-80700.........: 3453 Goldmaster SAT-80900.........: 3453 Goldmaster SAT-90200.........: 3453 Goldmaster SAT-90400.........: 3453 Goldmaster SAT-7200 FTA......: 2606 Goldmaster SAT-7300 CI.......: 2606 Goldmaster SAT-7400 CIM......: 2606 Goldmaster SAT-7800 PVR......: 2606 Goldmaster SAT-4150 FTA......: 2606 Goldmaster SAT-4100 FTA......: 2606 Goldmaster SAT-4800 PVR......: 2606 Goldmaster SAT-9200..........: 2606 Goldmaster SAT-9400 CI.......: 2606 Goldmaster SAT-9500 CIM......: 2606 Goldmaster SAT-9600 CIP......: 2606 Goldmaster SAT-9800 PVR......: 2606 Goldmaster SAT-9900 PVR......: 2606 Goldmaster SAT-8150 FTA......: 3141 Goldmaster SAT-8200 FTA......: 3141 Goldmaster SAT-8210..........: 3141 Goldmaster SAT-8300 CI.......: 3141 Goldmaster SAT-8350 CI.......: 3141 Goldmaster SAT-8400 CIM......: 3141 Goldmaster SAT-10200.........: 3141-9247 Goldmaster SAT-10210.........: 3141 Goldmaster SAT-11300 CI......: 9247 Goldmaster SAT-11400 CIM.....: 9247 Goldmaster SAT-15400 CIM.....: 9247 Goldmaster SAT-16000 ........: 1600 Goldmaster SAT-16300.........: 1600 Goldmaster SAT-16500.........: 1600 Goldmaster SAT-17000.........: 1700 Humax 5400 Master Code.......: Press the menu and go to installation menu and press red key & green key & yellow key & blue key & white key and 0 Now Pin code changed to 0000. HUMAX F1-C1..................: Menu - status - STB Status - ok -press UP button at the Front panel - i - press the button contain ( ? ) press yellow button - exit now your Receiver return to 0000 Hyundai......................: 0325, 6962 Hyundai 1100 MCOM............: 1004 Kaon.........................: Left to Right press Red, Green, Blue and Yellow buttons Kaon.........................: Press Yellow key, Enter 0000 Press Blue 2 times, Press Green 2 times, Press Red 2 times, Press Menu key. Kaon.........................: Yellow, Blue, Green, Menu Kyoto........................: 3453 Lazer........................: 3141 Lorans.......................: 1250 Mediacom MFT 930I............: 5347 Mediacom MFT 910I............: 1250 Mediacom EXEL................: 1250 Mediacom MCI Elite...........: 7777 Metabox 1-2-3................: 1004 Megastar 700 FTA.............: 2606, 3141 Megastar 800 CI..............: 2606 Megastar 800 CIM.............: 2606 Megastar 700 FTA.............: 3141 Natvision....................: 1668, 1010 Neosat.......................: 1631, 6805 Neosat Old SX 9600...........: 3472, 3478 Neosat SX-9800CI.............: 2580, 3842 Neosat New 9600..............: 8510 Neosat 9800I.................: 2142 Neosat 9800CI (old)..........: 8510 Neosat.......................: 1631, 6805 Next Wawe....................: 8503 Next 8000xcam................: 4132 Next gri seri................: 0000 Next plus serisi.............: 8503 Next 5000 serisi.............: 1234, 1004 Next siyah seri..............: 0000 Next 3000A...................: 0000 Next 3000AP..................: 0000 Next 1000 (STAR1 )...........: 5183 Next 10001 PLUS:.............: 3453 New QMA X....................: 0325, 0867, 0876 Nokia 9800-9860..............: 1234 Nokia 9200...................: 147258 Nokia 9600...................: 1234 Oliverstar...................: Press The Menu Key And ENTER 9999, Press OK. Onwa X2 FTA..................: 3141 Onwa X3 FTA..................: 2606 Onwa X4......................: 3141 Onwa X5 CI...................: 2606 Onwa X7 CIM..................: 2606 Onwa X9 PVR..................: 2606 Onwa X2 FTA..................: 3141 Onwa X6 CI...................: 3141 Onwa X13 CIM.................: 3141 Onwa X23 CIM.................: 3141 Opensky......................: 0786 Opentel......................: 0937, 3472 Pace.........................: 9949 Pansat.......................: 1668, 1010 Pengamin.....................: 1250 Radix........................: 9815 Redliner 9500 CI.............: 1001 Roadmaster...................: 7787 Samsat.......................: 0937 Samsung.... .................: 0235, 7777 Samsung 702..................: 9911 Samsung 202 SVACI............: 1631 Samsung Model DSR 2000.......: Press Menu Key, Go To System Setup And Go To System Information, Enter 0000. SanyoSat 5400-5700-7000......: 3472, 2374, 3724, 1250, 6893 SanyoSat Viaccess............: 7176, 2606, 1470, 2441 SanyoSat (Plus) 5000-9000....: 2606 Satcruiser...................: 3742 Sky X........................: 0103, 1004 Smart........................: 3472, 6934 Spark 1100...................: 1004 Spark 3000 Magic.............: 2441 StarPro......................: 5889 Starsat......................: 1234, 1361, 1999, 9876 Startrack....................: 0786 Strong.......................: 0235, 0325, 1361, 0735 Strong FreeCam...............: 0235, 0735 Sunny........................: 2580, 7777 Sunsui.......................: 0937 Super Lazer 20000/1000.......: 2142 SuperMax.....................: 8503 Superstar....................: 2142 Taplin.......................: 3453 TechnoSat....................: 3724, 2374, 7176, 2606, 1470, 2441, 3724, 1250, 6893 Teleman......................: 7176, 1973 Tokyo........................: 3472 Topfield.....................: 2999, 2606 Topfield 3100 FEI............: 2606 Topfield 3000 CIPRO..........: 2606 Topfield 3000 CIPPRO.........: 2606 Topfield 3100 CIPPRO.........: 2606 Topfield 3100 FI.............: 2606 Topfield 3100 FE.............: 2606 Topfield 3300 F..............: 2606 Topfield 3030 F..............: 2606 Topfield 4000 PVR............: 2606 Topfield 5000 PVR............: 2606 Topfield 5300 CI.............: 2606 Toshiba......................: 1048 Urobox.......................: 9999 Vestel.......................: 8277, 929526 Viewsat......................: 0937, 3570 Viva.........................: 0786 Vortec.......................: 2002, 7777 Wisplus......................: 5030 YuMaTu x-200.................: 8888 YuMaTu 9500..................: 8503 YuMaTu 5500-8000.............: 2441 Zinwell......................: 8888 :(Ariza-0786 Ariza Xtreme-go to menu, then go to info, hit ok then enter 3749 Captive Works- 9876 Digiwave- 1212 ExtremeView Magnum- 1818 Satcruiser-3742 Skyview-9876 Sonicview- 2242 |
| Posted by Nilanka Abeysinghe @ 8/2/2008 10:05:00 PM |
|
| Run many site with one IP address and default port (Virtual Hosting with IIS) |
| When we want to run more than one web site one static IP with default port, you can do it with virtual hosting in IIS.
Steps :
creating a new web site
IIS web sites -> new -> web site -> desc - > Host header for this Web site 
Existing web site select web site in the website list -> site properties -> web site tab – click Advance button Then Add -> port and Host Header value  |
| Posted by Nilanka Abeysinghe @ 7/27/2008 11:07:00 PM |
|
| Spell Checker for VS.NET 2005 |
| How to install: 1) Exit all versions of Visual Studio.NET 2005 and Microsoft Word. 2) Copy the ZIP file to your "My Documents\Visual Studio 2005\Addins" folder (If you don't have this folder you can create it. Also, using vs.net 2005 to create a New Add-in via the "Other Project Types->Extensibility->Visual Studio Add-in" will create it.) 3) Create a folder "My Documents\Visual Studio 2005\Addins\SpellCheckerForVs2005" and place all the unziped files into it. 4) Copy file "SpellCheckerForVs2005.AddIn" one subfolder up into "My Documents\Visual Studio 2005\Addins" 5) Done. Note: When you start vs.net 2005 you need to turn the Add-in ON via menu: Tools->Add-in Manager..." WARNING: Do NOT also check the "Startup" option for this Add-in (See HelpSpellCheckVs2005v1.htm why.)
|
| Posted by Nilanka Abeysinghe @ 2/11/2008 10:17:00 PM |
|
| How to make Firefox Faster |
Here is the way of doing it…
1. Type "about:config" into the address bar and hit enter. Scroll down and look for the following entries.
2. Alter the entries as follows: Set "network.http.pipelining" to "true" Set "network.http.proxy.pipelining" to "true" Set "network.http.pipelining.maxrequests " to some number like 30. This means it will make 30 requests at once. You can set this value in to any number,but i guess 30 would be more than enough..
3. Lastly right-click anywhere and select New à Integer. Name it "nglayout.initialpaint.delay" and set its value to "0". This value is the amount of time the browser waits before it acts on information it receives. |
| Posted by Nilanka Abeysinghe @ 2/10/2008 11:43:00 PM |
|
| C# open source library for generate PDF file ( iTextSharp) |
iText# (iTextSharp) is a port of the iText open source java library written entirely in C# for the .NET platform. iText# is a library that allows you to generate PDF files on the fly. It is implemented as an assembly.
You can download that library from this link http://sourceforge.net/projects/itextsharp/ |
| Posted by Nilanka Abeysinghe @ 12/6/2007 4:36:00 AM |
|
| Visual Studio .NET 2003 and 2005 Keyboard Shortcuts |
Here useful list of keyboard shortcut for Visual Studio .Net
- Go to declaration = F12
- Debug: step over = F10
- Debug: run to cursor = ctrl + F10
- Debug: step into = F11
- Debug: step out = shift + F11
- Toggle a breakpoint = F9
- Go to next item in task list or search results = F8
- Go to previous item in task list or search results = shift + F8
- Switch to code view = F7
- Switch to designer view = shift + F7
- Run with debugging = F5
- Stop debugging = shift + F5
- Run without debugging = ctrl + F5
- Move to previous edit point (back) : ctrl + -
- Switch to the Task List = ctrl + alt + K
- Switch to the Immediate window = ctrl + alt + I
- Switch to the Output window = ctrl + alt + O
- Find = ctrl + F
- Find in all files = ctrl + shift + F
- Replace = ctrl + H
- Toggle among open files= Ctrl + TAB
|
| Posted by Nilanka Abeysinghe @ 11/29/2007 2:47:00 AM |
|
| About Me |
Nilanka Abeysinghe
Nugegoda, Colombo,
Sri Lanka
|
|
|
|