The ListView raised event ItemEditing which wasn’t handled.

Error:
The ListView ‘ListView1’ raised event ItemEditing which wasn’t handled.

Resaon:
if the CommandName of a clicked button is “Edit” then it will put the ListView in the Edit mode, try modifying the CommandName=”Edit” to something like “modify”… its so easy πŸ™‚

ASP.NET ListView Item Delete Confirmation using jQuery Colorbox

The other day I was working on a .NET project I needed to perform a delete confirmation using jQuery Colorbox in ASP.NET ListView. After I spend long hours on internet I couldn’t find solution and come up with this idea. Hope you will enjoy it πŸ™‚

Solution

Step 1: Add jQuery and Colorbox

you can download colorbox from https://github.com/jackmoore/colorbox

You can find jQuery Colorbox examples here http://www.jacklmoore.com/colorbox/

Step 2: Add the following inside < head > tag

Step 3: ASP.Net Listview using CommandArgument to delete the item

 

You can find much detailed information from ASP.NET Wiki: https://wiki.asp.net/page.aspx/1809/aspnet-listview-item-delete-confirmation-using-jquery-colorbox/

HttpResponse.RedirectPermanent in ASP.Net 4.0

If you want to redirect a page permanently to the new location, ASP.Net 4.0 introduces a new method ie, HttpResponse.RedirectPermanent

example:
Response.RedirectPermanent(“http://www.menonon.net/MyNewPage.aspx&#8221;);

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. SQL Server Management Studio 2008

Error Details:

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.

You need to Disable “Prevent Saving Changes that requires the table re-creation”.

  1. Open SQL Server Management Studio (SSMS) 2008
  2. Click ‘Tools’ Menu
  3. Then Click ‘Options’ as shown
  4. In the navigation pane of the Options window, expand Designers node and select Table and Database Designers option as shown in the below snippet

Risks of Turing Off “Prevent Saving Changes that Require Table Re-creation” in SSMS
If you turn off this feature then you can avoid table recreation. However, if you have the Change Tracking feature of SQL Server 2008 enabled to track the table changes then the change tracking information will be lost completely whenever table is recreated. So, it is always advised to use this feature very carefully especially in a production environment.

System.FormatException: Invalid length for a Base-64 char array.

Exception Details: System.FormatException: Invalid length for a Base-64 char array.

While passing the data through GET, Request.Querystring object interprets the β€œ+” sign as a space, and that causes problems for encoding. This throws error Invalid length for a Base-64 char array. You can resolve this issue using

Example:


While passing the data through GET, Request.Querystring object interprets the β€œ+” sign as a space, and that causes problems for encoding. This throws error Invalid length for a Base-64 char array. You can resolve this issue using

System.Security.Cryptography.CryptographicException The system cannot find the file specified

Error Details: System.Security.Cryptography.CryptographicException The system cannot find the file specified

New Security constraints that were included into the windows server 2008, and a new user CryptoGraphic Operator will be created by default. If your Application is using RSACryptoServiceProvider on windows server 2008 with IIS 7, you can troubleshoot above issue through these steps easily.

  1. INETMGR (IIS 7) > Application Pools > YourApplicationPool > (Right Click) Advanced Settings > Set the Value of “Load User Profile” to “TRUE

IIS 7