Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes. June 2006 Entries
Changing Font-Size of a Hyperlink inside the Repeater Control
This was a question asked today on the ASP.NET Forums. Although you might be wondering that hey I can just use "" and it will work. For some reason it does not work and the work around is to create a CSS class and define the properties in that class. Take a look at the code below: <style type="text/css">.link_co... { font-size:25px; } .hoverOut_Font { font-size:12px; } </style> And here is the Code Behind: protected ......

Posted On Thursday, June 29, 2006 3:43 PM

Populating TreeView Control With Database
I have recently published an article on GridViewGuy on how to populate the TreeView control using the database. The article demonstrate the solution using entity classes. Here is a small code snippet from the article. // This method is used to populate the TreeView Control private void PopulateTreeViewControl(Lis... categoryList) { TreeNode parentNode = null; foreach (Category category in categoryList) { parentNode = new TreeNode(category.CategoryN... category.CategoryID.ToStrin... ......

Posted On Wednesday, June 28, 2006 8:51 PM

Okay, this is pretty bad error and it has not been resolved. I have a business class ArchiveCourse which has several methods that communicates with the data access layer. Now, I added a new method in the ArchiveCourse class named "GetMyCourses()". Everything is good but the problem comes when I try to access this method from the code behind file of a webform. It is not able to recognize the new method "GetMyCourses()". So, I right clicked on my class and select "Go to defination" this opened a new ......

Posted On Wednesday, June 28, 2006 1:37 PM

Problems Uploading the PDF Files
Now, this is really strange. I planned to upload the PDF files and the "Page Not Found" page just shows up. I tried to upload an image and it worked fine. Below is the simple code that I am using. When I use a pdf file it won't even step into the method below. protected void BtnUpload_Click(object sender, EventArgs e) { try { string path = @"C:\ServerFolder\"; FileUpload1.SaveAs(path); } catch (Exception ex) { string exception = ex.Message; } } Any ideas? powered by IMHO 1.3 ......

Posted On Monday, June 26, 2006 10:16 PM

Moving Out to a New Apartment
Finally, I am moving out of the crappiest apartment you can ever imagine. My new apartment is little far from work but it is 100 times better then the old one. Finally, I will have a DSL connection, believe me or not but I was living on a dialup connection. Yeah, I know I am living in STONE AGE. But the reason is simple my old aparment did not have the facility to provide a high speed connection. Once, I move into the new apartment which is July 1st, 2006 I will get the DSL (Yahoo DSL). Since, that ......

Posted On Monday, June 26, 2006 2:46 PM

Using ATLAS TextBoxWaterMark Control
A new video has been published on the aspalliance website. In this video I demonstrated that how you can use the TextBoxWaterMark Control which is part of the ATLAS Control Toolkit. You can view the video at the following link. To check out all the videos please use the following url. ASPAlliance also provides RSS Feeds for the videos so you can always get the most updated information. Check out the RSS Feed link below: ......

Posted On Monday, June 26, 2006 11:04 AM

Displaying Running Total in GridView
Someone asked on ASP.NET forums that how you can display a running total inside the GridView control. I thought it would be a exercise to implement a simple application that keeps a running total. You can implement the running total in different ways but I think the best way is that when you enter the number in the TextBox it should be added to the total. In this way you don't need to do any postback and hence you don't need to wait. I have implemented the running total application which can be viewed ......

Posted On Monday, June 26, 2006 11:01 AM

My Trip to California June 15 to June 20th
Hi, As, you already know I was away for a while from June 15th to June 20th. I went to California to meet my beautiful wife. Apart from all the cool places that we went I think the best place was Yosemite. It is a long drive to Yosemite (3 hours) from my Tracy but I have to tell you that it is worth every second. Yosemite is a park which has several waterfalls and beautiful forests. The park in whole is extremely large and my advice is that if you go then stay for atleast 2-3 days. Since, the Yosemite ......

Posted On Sunday, June 25, 2006 12:20 PM

BAD Days for my poor laptop
Yesterday (June 22nd 2006) I spend my whole day at work fixing my laptop. For some reason it was throwing the Video Card Error. After I fixed it then it started throwing the memory error. Finally, I removed the 1GB RAM and booted the computer and it worked fine. It is very hard to give up 1GB RAM :(. Now my computer is running only 512 MB which is pretty slow. My colleages told me to FORMAT the harddrive but formatting is always the last option on my list. Not because I will loose all my precious ......

Posted On Friday, June 23, 2006 10:11 AM

Exporting Large DataSets to Excel
I am not sure if I have already posted this entry but here it is again. Mr Brian Jones posted this tip on the GridViewGuy website. If you try to export a very large dataset to excel then you might get the Page not found error. In order to fix that all you need to do is to override the httpruntime node in the web.config and set the maxRequestLength to something higher then 4096. This will solve your problem. powered by IMHO 1.3 ......

Posted On Thursday, June 22, 2006 8:58 PM

CodeDom And Creating Entity Classes
Few days back I blogged about generating the code using the CodeDom classes. You can view that post over here. I worked on it for a little more and now you can input the namespace, class name, database name and the table name from the console. Below you can see a screen shot of the code generator which creates the entity class for the Categories table in the Northwind database. As, you can see that you will have to give the inputs in the required format which is the following: NameSpace:ClassName: ......

Posted On Wednesday, June 21, 2006 9:25 PM

Using ATLAS Round Corner Control [VIDEO]
ASPAlliance has just published a new video tutorial. In this tutorial I will demonstrate that how you can use the ATLAS Round Corner Control which is part of the ATLAS Control Toolkit. You can view the video using the following link. powered by IMHO 1.3 ......

Posted On Wednesday, June 21, 2006 2:18 PM

Back from the Vacation


I am back from my vacation. It was awesome. I will be blogging about that later this evening. Now, switching my cap to the programming mode.

Take care,  



powered by IMHO 1.3

Posted On Wednesday, June 21, 2006 9:04 AM

Signing Off for couple of days (I will be back next week on wednesday)
Hi, I am signing off right now. I Am in California enjoying time with my wife. I will be posting some geeky stuff once I get back. bye,

Posted On Thursday, June 15, 2006 2:09 PM

Creating Entity Classes Using CodeDom
CodeDom namespace is simply amazing, it lets you to write language specific code. I was just mingling with CodeDom namespace and though why not create Entity Classes which maps to the database table. So I put together this small piece of code which creates the entity class. All the data in the example below is constant but I am sure that you get the idea. Here is my Code Generator: using System;using System.Data;using System.Configuration;using System.CodeDom;using System.CodeDom.Compiler;using System.Text;using ......

Posted On Wednesday, June 14, 2006 7:06 PM

Don't Install LINQ MAY CTP
Hi, This is a warning to everyone. Do not install LINQ May CTP it is going to bust the intellisense, smart tag and refactor menu. Wait till they release the final version. PS: The smart tag for which is used to add the namespace Shift + Alt + F10 is also busted. powered by IMHO 1.3 ......

Posted On Wednesday, June 14, 2006 1:50 PM

The Deployment Switch in ASP.NET 2.0
ASP.NET 2.0 web configuration supports the <deployment> tag which has the retail attribute. The retail attribute when set to true will disable tracing, debugging and detailed errors. This is a very cool tool for the site admins to turn off the settings with the use of a single switch. You can use the deployment option like below: <deployment retail = "true" /> powered by IMHO 1.3 ......

Posted On Wednesday, June 14, 2006 1:20 PM

Database Design Issues
Database Design is one of the most difficult tasks in the software world. The weak design of the database can lead to problems which are extremely hard to fix. I encountered a scenario in which you have a bit field in the database which represents the status of the record. Let's say that bit field is called "Active" and Active = 1 means that the record is active else it is inactive. Now, everything works okay but what if we push in another criteria which is "pending" meaning that the record is in ......

Posted On Tuesday, June 13, 2006 2:01 PM

Video: ATLAS Confirm Button
I am happy to announce that a new video has been published on You can view the video at the following URL. In this video I have demonstrated that how you can use the ATLAS Confirm Button Extender Control. powered by IMHO 1.3 ......

Posted On Tuesday, June 13, 2006 10:23 AM

LINQ IDE Support for C# is busted
I just installed the Linq May CTP but still the intellisense is not working. Even if I start a new project (Not a Linq project) the intellisense does not work. The only solution that I found was to uninstall the C# IDE support by running the script file in the bin folder of the LINQ installation directory. powered by IMHO 1.3 ......

Posted On Tuesday, June 13, 2006 9:01 AM

Going to California for couple of days!
Hello Everyone, I just wanted to let you guys know that I will be out for couple of days. I am going to California to visit my beautiful wife. I won't have access to any email so I won't be able to reply to any post and questions. Take care everyone, Azam powered by IMHO 1.3 ......

Posted On Tuesday, June 13, 2006 8:45 AM

Disabling the Button While the User Wait!
I got this awesome tip from one of the Starter Kits. The following code will disable the Button control and display the please wait message until the page is refreshed. It is simple, clean and beautiful! Check out the code below: this.MyButton.Attributes.Ad... "this.value='Please wait...' ;this.disabled = true;" + ClientScript .GetPostBackEventReference(... "")); powered by IMHO 1.3 ......

Posted On Sunday, June 11, 2006 9:50 PM

ViewState Chunking in ASP.NET 2.0
ASP.NET 2.0 introduces the ViewState Chunking mechanism. This means that if your ViewState is too large then it will be broken into small chunks. The reason behind this feature is that many firewalls and proxies does not accept the huge ViewState sizes. You can set the MaxPageStateFieldLength property in the web.config <pages> section. The property represents the number of bytes. By default the value is -1 which means no chunking. <pages maxPageStateFieldLength="15... </ pages> powered ......

Posted On Friday, June 9, 2006 9:52 PM

Checking if the URL Exists!
Sometimes you need to find out that if the urls on the page exists or not. The following code reads the HTML of the page and extracts all the urls and finally checks if the url exists or not. Take a look at the following code: protected void Button1_Click(object sender, EventArgs e) { WebRequest req = WebRequest.Create("http://l... LookIntoDoPostBack/UrlList.... HttpWebResponse res = (HttpWebResponse) req.GetResponse(); Stream stream = res.GetResponseStream(); ArrayList badUrls = new ......

Posted On Thursday, June 8, 2006 8:45 PM

Auto Select Text in TextBoxes inside GridView (Edit Mode)
You can select the text inside the TextBox of the GridView when you click inside the TextBox. This is pretty simple here is the code: <EditItemTemplate> <asp:TextBox ID="txtFirstName" onfocus="" runat="server" Text='<%# Eval("FirstName") %>' /> </EditItemTemplate> powered by IMHO 1.3 ......

Posted On Thursday, June 8, 2006 8:44 PM

Application Pools in ASP.NET
If your server is hosting ASP.NET 1.X and ASP.NET 2.0 applications then it is better to create the application pools and run the applications under designated application pools. Application pools allows you to separate the .NET 1.X and .NET 2.0 process from each other. You can create application pools in Window Server 2003 and IIS 6 by using the control panel -> IIS and click on the item which says "Application Pool". Once, you have created the application pool you can simply right click on the ......

Posted On Thursday, June 8, 2006 10:40 AM

Up Coming Videos on ASPALLIANCE
If you are curious like me and want to know about the up coming videos on ASPALLIANCE then this is the post for you. Here is the list of the up coming videos: 1) Using the ATLAS Round Corner Control 2) Using the ATLAS TextBox Watermark Control 3) Using the ATLAS Confirm Button Control 4) Using the Timer Control to display and change advertisment without doing a POSTBACK 5) Using the ATLAS PopUp Control (Working with the Calendar Control) 6) Using the ATLAS PopUp Control (Workding with the Calendar ......

Posted On Tuesday, June 6, 2006 3:12 PM

More blogging about the ASPALLIANCE Videos
I just have to blog on this more since it is really awesome. If you have not already checked out the Videos Section on ASPALLIANCE then you should do it right away. The videos will target ASP.NET Technology including ATLAS and ATLAS Control Toolkit. There will be lots of videos in the future. Each video is few minutes long which will guide you step by step to complete a specific task. Subscribe to the RSS Feeds right now!!! Here are few links: ASPALLIANCE Website Steven Smith ......

Posted On Tuesday, June 6, 2006 1:08 PM

Hi Everyone, One of the largest knowledge based website ASPALLIANCE has created a videos section. These videos will be small tutorials which shows how to accomplish specific task. At present the videos are focused on the ATLAS framework. The hardworking team of ASPALLIANCE will try their best to produce atleast one video per week. Please check out the videos using the following link: powered by IMHO 1.3 ......

Posted On Monday, June 5, 2006 2:38 PM

The New Null-Coelscing Operator in C# 2.0
There is a new operator in town. It is called Null-Coelscing operator. The operator takes two operands, if the operand on the left is not null then it is returned else the operator on the right is returned. Check out the code examples below: static void Main(string[] args) { string userName = null; Console.WriteLine(userName ?? "AzamSharp"); // displays AzamSharp // int someNumber = 10; // Console.WriteLine(someNumber ?? 30); // compile //time error ?? cannot be applied to value types int? number ......

Posted On Friday, June 2, 2006 10:18 PM

Displaying Nested Data
Most of the websites require to present the Nested data to the User. Take a look at the data below which is nested: Category1 Product1 of Category1 Product2 of Category1 Category2 Product1 of Category2 Product2 of Category2 I am sure you get the idea. In my latest article "Nested Repeaters to Display Nested Data" I demonstrated that how you can use nested repeaters with simple DataSet Relations to display the nested data. powered by IMHO 1.3 ......

Posted On Friday, June 2, 2006 8:50 PM

GridViewGuy Anniversary (Thank you very much to all the users)
Wow! it has been one year from the day I started GridViewGuy back in June 2005. The website has been growing steadily since then. I would like to thank all the users who visited the website and made this website worth running. I would like to thank all the users who emailed me with feedback and suggestions. It was because of those feedbacks and suggestions that I was able to improve the website. I would also like to thank all the members of the ASP.NET forums who were always willing to answer my ......

Posted On Thursday, June 1, 2006 8:38 AM

Copyright © Mohammad Azam | Powered by: