Jan 23 2006

CSS 3-Column Generator

Category:Bil@l @ 18:36

I would like to share with you this cool link on how to generate a 3-column page template with CSS.

3-Column Generator

Enjoy CSSing ;)

 

Regards

 

Tags:

Jan 22 2006

Install Application Services Database on Microsoft Sql Server 2000

Category: ASP.NET 2.0 - GeneralBil@l @ 20:01

ASP.NET 2.0 ships with a set of providers for different features. We have the profile, membership, personalization and other new features that require a set of database tables and stored procedures, which are known as Application Services Database.

Usually when you create a new web application in ASP.NET 2.0 using either Visual Studio 2005 or Visual Web Developer, those tools would automatically build the database to use in either the Microsoft Sql Server 2005 or in the Microsoft Sql Express 2005.

However, if you still want to use the new features in ASP.NET 2.0 that need the database, with Microsoft Sql Server 2000, that is possible too. There is a tool called aspnet_regsql.exe that you can use in order to install the database on Microsoft Sql Server 2000.

In this post, we will go through a step by step tutorial on how to do so.

First of all, open a new comand prompt windows, go to:

{DriveLetter}:\Windows\Microsoft.Net\Framework\{Version Number}\aspnet_regsql.exe

Once you run this, the following screen is shown in front of you:

Click Next.

You have the choice to either install a new Application Services Database or remove an existing one from one of the databases you installed before. In this case we want to install new one, so choose the first option and press Next.

You will need to put your machine name instead of *Development*, it is the name of my VPC that I develop on. You can use either Windows or Sql authentication. In case you want to use Sql Authentication, then should have previously created the username and password on the database you want to install the services databased. Finally choose the database where you to install the services related database. Click Next. 

Click Next.

Click Finish.

 

Hope this tutorial helps,

 

Regards

 

Tags:

Jan 22 2006

ListControl property : AppendDataBoundItems

Category: ASP.NET 2.0 - GeneralBil@l @ 12:30

In ASP.NET 1.1, we used to bind a ListControl or any other control inheriting from it to some source of data, after that we used to add a new item at location 0 to tell the user to choose a value, like :  -- Choose a Value --

We always had to do so AFTER binding the ListControl to its data source, else the binding will remove all previous items in the ListControl.

Today, in ASP.NET 2.0, we have the ListControl's property, called AppendDataBoundItems, once this property is set to true, this tells the ListControl NOT to clear the ListControl items before binding to data, so now we can add an item on the top of the ListControl, then simply bind the ListControl to the data source we have. an example is given beloe:

this.ddlItems.Items.Add("- Choose an Item -");
this.ddlItems.AppendDataBoundItems = true;
this.ddlItems.DataSource = CreateDataSource();
this.ddlItems.DataBind();
this.ddlItems.DataTextField = "Name";
this.ddlItems.DataValueField = "ID";

Hope that helps you

Regards

Tags:

Jan 22 2006

Nested Datagrids in ASP.NET 1.1

Category:Bil@l @ 09:31

I got a question from a friend of mine  in Canada, on how to Edit the Nested Datagrid in ASP.NET 1.1, I referred her to the following good links:

Hope that helps you.

Regards

Tags:

Jan 21 2006

ASP.NET 2.0/1.1 Popup Calendar

Category:Bil@l @ 23:30

I would like you to visit this site and check the FREE ASP.NET 2.0/1.1 Popup Calendar.

I just used it in an ASP.NET page I am developing, its configuration is so simple, and easy to use.

Go and check it.

Regards

Tags:

Jan 21 2006

AssociatedControlID in ASP.NET 2.0

Category:Bil@l @ 21:02

I am customizing the CreateUserWizard to add some fields when adding a new user, and noticed that property called: AssociatedControlID.

For example:

<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="txtUserName">UserName</Label>
<asp:TextBox ID="txtUserName" runat="server" />


You can see that you have associated the Label FOR the TextBox. When the page runs, go to view source and you will find this:

<label for="txtUserName" id="UserNameLabel">UserName</label>
<input name="txtUserName" type="text" id="txtUserName" />

You will notice the FOR property added. This tells the Label that it is associated with the TextBox called *txtUserName.*
When you click your mouse on the label, the cursor will be active inside the TextBox, that is really cool :D

Regards


 

Tags:

Jan 21 2006

Internal and Public Access Modifiers in C#

Category:Bil@l @ 16:47

I am working on a project, in which I have several Class Libraries. In one of the class libraries, I wanted to use an object that can be accessed only inside the class library. What I did is I created the class as:

internal class X
{
    // Class content
}


Among my class in this class library, I had two objects, one of the objects calls a method inside the other object, and passes to it a parameter of type X, which is an internal object. One thing to mention here that all methods inside those objects have public direcive.
I used to get this error message:

Error 9 Inconsistent accessibility: parameter type 'NameSpace.X' is less accessible than method 'NameSpace.Object1.Create(NameSpace.X)'

I relaized later after some debugging that, when you want to pass an object marked as internal between methods in seperate objects, those objects should also be marked internal and not something else.

You might say, how will be able to access those methods from outside the class library. Well, in my case, I needed to use those internal objects for internal processing inside those methods. So, if a class has a method that uses one of the internal objects to process X job and then returns a value that has a basic data type or a custom object (not marked internal), then all work fine. Example:

public class Y
{
    public static bool IsRegistered(string username)
    {
        X _x = new X(username);
        bool result = IsValid(_x);

        return result;
    }    
}

As you can see, Y is a public class, and a method inside it is using the internal object and thus, that would be ok.

Hope that helps you.

Regards

Tags:

Jan 20 2006

Online RSS Reader

Category: General | GeneralBil@l @ 11:36

Hello:

I came across http://www.Squeet.com, which is a nice online utility to subscribe to blogs online. The nice thing about that tool, is that, all the new posts added by bloggers that you have subscribed to, will be sent to your inbox.

Also, I have been using the JetBrains Omea Rss Reader, I just exported my feeds, and imported them to Squeet and it worked smoothly.

Hope you like that tool!!

Regards

 

Tags: ,

Jan 20 2006

How to install Community Server 1.1 on my machine?

Category: Community ServerBil@l @ 07:07

I got a request from a friend of mine, asking me how to install and configure CS 1.1 on a hosting area.
I will take you in a step-by-step tour on how to be able to install CS 1.1 on your own hosting area.


1- Download the CS 1.1 binaries; click here to get them now.
2- After you download the zip file, you extract it into any place of your choice.
3- Now we need to create a website for the CS. To do so, you go to the Internet Information Services MMC, and create a new website under the default website, with the Alias name as cs. Make the website’s, *localhost/cs*,  home directory point to the Web folder included in the download of CS. This Web folder includes all the files that constitute the CS website.
4- Now, after creating the website, we need to install the CS. How to do so?
5- Before we install CSS, we need to open our Sql Server Enterprise Manager, we create a new Database named *username_CommunityServer*, make sure you change the word username with a name of your choice, why? Because if you want later on to publish that CS into your hosting space and your hosting space is a shared hosting space, then there might be a conflict with other databases, so to be on the safe side, name it according to the above mentioned pattern.
6- You may also need to create a new Database Login user and assign its permissions to the new database you just created.
7- Now it is time to install the CS, but wait, we still have some configuration steps we need to do:
a. Go to the Web folder, open the Web.config , locate the following line:
<add key="SiteSqlServer" value="server=(local);uid=;pwd=;Trusted_Connection=yes;database=communityserver" />


Here, you will need to add the username and password to be able to access the local database. In addition, you can turn off trusted connection by putting it to no.
b. There is an installer that ships with CS to be able to install it on your machine. Got to the Web folder and locate the Installer folder. Open the folder and find the default.aspx page, inside that page you will need to locate the following line:
bool INSTALLER_ENABLED = false;


Make sure you enable the installer by setting a value of true above. Then when you finish installing CS, make sure you reset the value to false.
c. Open a new IE browser, go to http://localhost/cs/installer. This is a step by step wizard that helps you install CS on your machine.
d. The first screen that you face is the following:
 

Click Next

You agree to the terms and click next

You put the username and password you created before in the Sql Server Enterprise Manager. Click next

In this step, you select the database instance where you want to install the CS database. You would need to select the empty database you created in a previous step. Click Next

Select all the options and click next.

In this step, you can change the URL of the community; I suggest leaving it as it is. Then enter a username/password for the administrator of the community. Click next to go to the final step.

Congratulations, now you have a working version of the CS 1.1. To lunch the website and make sure everything is working fine, open a new IE browser, type the following:
http://localhost/cs.
Make sure you disable the installer as mentioned above.

In this post, we learned how to install and configure the CS 1.1 on your local machine. In next posts, we will learn how to publish this installation to your hosting account and be able to access it online.

Hope you found this post beneficial,

Regards

Tags:

Jan 18 2006

My Official Blog

Category: General | GeneralBil@l @ 08:27

Hi:

I would like to welcome you all to  my official blog, which is now hosted on my own hosting account.

I installed the CommunityServer 1.1 locally, then uploaded the files and the database to my hosting account at WebHost4Life.com.

I used the FoggyValley theme for  my Blog, which can be downloaded from here.

I also used the Single Blog/Gallery SiteUrls Generator for CS 1.1, which helped me create a single blog/gallery on this website.

I hope you like my new website. I wish I will be able to deliver good stuff for you all, to benefit as much people as possible all over the world.

Keep an eye on this blog for .NET tips, tricks and good resources.

I would like to thank WebHost4Life Technical Support and Wessam Zeidan, the Palestinian MVP (Lebanon Resident), for helping me out on configuring and installing my new blog.

Regards,

 

Tags: ,