Wednesday, November 29, 2006

ASP .NET 2.0 Web Parts and SQL 2000

If you want to use web parts in a web application, you need a SQL database in the background, as the settings a user applies to a page containing webparts must be stored in a database for retreiving every time that user logs in the application. The default setting of the database connection is managed by the WebPartManager control and it implies the usage of SQL 2005 (Express). This control creates the connection to the database and a mdf file that stores the data inside the App_Data directory. This file supports the storage in the application directory, advantages being obvious.

But what do we do if we only have SQL 2000 available? SQL 2000 does not support user instances, thus mdf files. So, if there is no SQL 2005 installed on the machine the application runs and there is no alteration of the default settings, we will encounter an error.

What is the solution? There are 2 steps necesarry to configure SQL 2000 usage instead of 2005:

1. Configure SQL 2000 to contain the databases and stored procedures used by the WebPartManager. For this action, use the aspnet_regiis executable located in WINDOWS\Microsoft.NET\Framework\v2.0.50727 . This tool is a wizard that allows you to select a database where the tables and procedures will be created.

2. Modify the application web.config file to point to the previously configured database. The WebPartManager implicitly uses a connection named LocalSqlServer. You can overwrite it this way:

 

When you next run the application, you won't encounter any error related to the SQL Express access.

So, same as with all providers in ASP.NET 2.0, these configuration actions create a flexible architecture for which the back end data storage can be changed without any modifications to the pages or Web parts in the application.

Posted by Madalina at 11:27:23 | Permanent Link | Comments (0) |

Thursday, November 23, 2006

Meebo!

www.meebo.com

This is a new utilitary that allows you to sign in all your messenger accounts with no trouble at all, anywhere and anytime. You don't need to install all the beta releases of the messengers, you just need a browser and you are set. You can login more accounts at once and your contacts will appear in the same messenger-like window:

All the conversation windows will appear in the browser window. No popups, no flashing annoying taskbar.

Meebo is built with AJAX ;)

Posted by Madalina at 11:01:02 | Permanent Link | Comments (0) |

Monday, November 20, 2006

Custom Validator - empty Text Box

Scenario:

- a radio button list with options

- a text box

- a button

The text box must not be empty if option No 1 is selected. So you add a custom validator to do the job:

<asp:CustomValidator  ID="CustomValidator1" runat="server" ControlToValidate="TextBox1"
            ErrorMessage="1 is checked. Please insert some text."  ClientValidationFunction="MyCustomValidator" Enabled="true"></asp:CustomValidator>

And also write the function.

The issue here is: although the function is correct, the validator is not trigered.

Solution:

Add the ValidateEmptyText="true" attribute in the validator tag.

Posted by Madalina at 15:35:16 | Permanent Link | Comments (0) |