Showing posts with label ASP.NET. Show all posts
Showing posts with label ASP.NET. Show all posts

Saturday, August 22, 2009

ASP.NET Grid View Hidden Column Binding Problem

When I was using Grid View in my Web Application I run into problem where hidden column would not bind data. After searching I found a simple solution to this problem. Let’s have a look at example. We have a table called Person with columns ID, FirstName, Surname. In our page we want to show only FirstName and Surname columns and have ID column loaded but hidden.

For a Grid View component create RowCreated event handler with the code:

protected void GvRowCreated(object sender, GridViewRowEventArgs e)
{
    // Hide ID Column
    e.Row.Cells[0].Visible = false;
}

The code above will hide all cells in column Cells[0], which is ID column. If Grid View has paging enabled we need to check e.Row.RowType == DataControlRowType.DataRow to hide only Cells that contain data.

0

Monday, July 6, 2009

CSS References and Tools

Every web designer and developer knows how powerful Cascading Style Sheets are and how much they can save in HTML coding.

I put together several links to CSS tutorials, samples and Internet resources.

CSS Books

CSS Tutorials

CSS Templates and Samples

Web Designer Tools

  • Rounded Graphics for CSS Box Corners - Cornershop

Resources

0

Monday, June 29, 2009

Free ASP.NET Learning Resources

In this post I would like to put together a list of ASP.NET learning resources.

Basic ASP.NET Walkthroughs

Advanced ASP.NET Walkthroughs

Visual Web Developer

ASP.NET Settings Schema – Reference for ASP.NET configuration section schema

ASP.NET Deployment

Additional Resources

ASP.NET FAQ's: Part I, Part II

ASP.NET MVC - is a free and fully supported Microsoft framework for building web applications that use a model-view-controller pattern.

Building a Great Ajax application from Scratch by Brad Abrams : AjaxWorld Talk

Web Deployment Projects - provide additional functionality to build and deploy Web sites and Web applications in Visual Studio 2008.

0

Tuesday, June 2, 2009

Free Windows Software Development Tools

Here is a list of free development tools I found useful and also popular in Software Development.
Large Text File Viewer - this program was designed for viewing large (>1GB) text files.

KompoZer - is a complete web authoring system that combines web file management and easy-to-use WYSIWYG web page editing.

UMLet - is an open-source UML tool with a simple user interface.

OpenProj - is a free, open source desktop alternative to Microsoft Project. It's available on Linux, Unix, Mac or Windows.

WinSCP - free SFTP and FTP client for Windows.

VMWare Server – run other operating systems on the same computer.

Microsoft SQL Server Management Studio Express - is a free, easy-to-use graphical management tool for managing SQL Server 2005 Express Edition and SQL Server 2005 Express Edition with Advanced Services.

Liquid XML Studio Free - XML Developers Toolkit and IDE.

ToDoList - A simple but effective way to keep on top of your tasks.

Microsoft Visual Studio


Visual Studio 2005 Express Edition - Easy way to start development with Microsoft tools.

Visual Studio 2008 Express Edition - Easy way to start development with Microsoft tools.

Subversion Tools


TortoiseSVN - A Subversion client, implemented as a windows shell extension.

Commit Monitor - is a small tool to monitor Subversion repositories for new commits.

SVN (Subversion) - version control system that is a compelling replacement for CVS in the open source community.

SVN Notifier - is a simple and useful tool to monitor your Subversion project repository for changes.

0

Sunday, May 17, 2009

System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

Recently I was installing CruiseControl.Net Server and got the following error when tried to open Server Dashboard “Server Error in '/ccnet' Application. Failed to access IIS metabase.”Appears that if IIS Server was installed after installing .Net Runtime then it will not have .Net correctly registered with it. To fix this all we need to do is to run

aspnet_regiis.exe /r


or


apsnet_regiss.exe /i if running Vista. /r option is not available under Vista.



Above utility is very useful for solving .Net related issues and have different options to work with .Net.

0

Friday, March 20, 2009

Free Icon Collections

Recently I was looking for free icons I could use for my web and desktop application development and came across few sites. Below is a list of links and references that might be very useful.

Application Icons

Sweetie - Cute and clear icons

Sizcons - A nice and useful set of icons to customize your applications

ASP.NET Icons - 300 professionally designed icons for your ASP.NET applications

Animated GIFs

Activity indicators - Link1, Link2, Link3

Free Internet Icon Search Services

ICONLook - Search Icons on Internet

IconFinder - ICON Search made easy

IconLet - ICON Search

Icon Search Engine - Search ICONs on Internet

References

For these who likes to see more follow the links below.

Free 40 Icon Sets

Pinvoke

20 Free and Fresh Icon Sets

Icons for your Desktop and Web Designs

Free Icon Web 35 Free Icon Sets

Icons Free

Icon Archive

Icon BAZAAR

Free Icons, Buttons and Templates

Icons Review Open Clipart

55 Free High Quality Icon Sets

Thursday, February 12, 2009

ASP.NET page validation and redirection to a new page

I was working on the ASP.NET web site where users register using form and get redirected to a different page on pressing submit button. Easy way to redirect to a new page is to use PostBackUr property of the button.

<asp:Button runat="server" ID="BtnSubmit"  Text="Submit" PostBackUr="newpage.aspx" />



Unfortunately this does not work if we need to handle button OnClick event. Solution is to use Server.Transfer or Response.Redirect of the Page control.



protected void BtnClick(object sender, EventArgs e)
{
if (Page.IsValid)
{
// Do something ...

Response.Redirect("newpage.aspx");
}
}


Page.isValid is true if all validators on the page and in web controls returned valid. A very good explanation about the difference between Server.Transfer and Response.Redirect can be found in the link below.



Server.Transfer Vs. Response.Redirect

0

Thursday, February 5, 2009

Getting Started with AJAX development and AJAX Control Toolkit

Developers who use Visual Studio 2008 know that AJAX already built into ASP.NET for .Net 3.5 Framework. All they need is to get AJAX Control Toolkit.

AJAX Control Toolkit .Net 3.5

How Do I: Get Started with ASP.NET AJAX? is an excellent video that helps to get started.

AJAX for .NET 2.0

If you are developing pure .Net 2.0 ASP.NET website or still using Visual Studio 2005 you need to get AJAX 1.0 and  AJAX Control Toolkit for .Net 2.0.

ASP.NET AJAX 1.0

ASP.NET 2.0 AJAX Templates for Visual Studio 2008

AJAX Control Toolkit for .NET Framework 2.0, ASP.NET AJAX 1.0

AJAX Tutorials and Documentation

AJAX Website has extensive number of Tutorials and Control Toolkit has a sample website that will be very helpful to make learning curve shorter.

ASP.NET AJAX Videos

ASP.NET AJAX Documentation

AJAX Control Toolkit Tutorials (C#)

ASP.NET Learning Centre

Deployment of AJAX enabled websites

Once development is finished and project need to be deployed to testing or production servers, install ASP.NET AJAX 1.0 on the server if you are deploying ASP.NET 2.0 website. ASP.NET 3.5 website will require only .NET 3.5 runtime installed on the server. There is no need to install AJAX toolkit as long as toolkit DLL is distributed in bin folder.

0

Tuesday, January 27, 2009

ASP.NET Access DB write problem

Recently I was working on simple ASP.NET website that had to update Access Database. Everything was fine during development when I was using ASP.NET Development Server created by Visual Studio. Later when I connected with Internet browser to http://localhost/mywebsite/Default.aspx I started getting two kind of unhandled exceptions on Database insert and update.

Microsoft JET Database Engine error '80004005'

The Microsoft Jet database engine cannot open the file 'C:\DB\YourDatabase.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

or this one

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

After looking on the internet I found a couple of links that shed some light on this problem.

How Do I Fix ASP 80004005 errors? - Imar.Spaanjaars.Com

An unhandled exception may occur when you try to connect to an Access database from an ASP.NET worker process.

I tried to fix a problem by following instructions on these pages, unfortunately adding permission for IUSR_MyComputerName system user to access DB folder did not make a difference. The quick and easy (and NOT RECOMMENDED for production installation) solution is to add Everyone to access to DB folder and write to database. I want to repeat that this is not a good solution for security reasons, my preference is to try to change an account under which IIS service is running. I will post my solution later once I get it working.

References

How to configure file sharing in Windows XP

0