Using Yahoo.UI.Calendar in PageTemplate and Master Page – Part II

Downloads ~ Using YU.Calendar in BasePage (ASP.NET 1.1)
Using Yahoo.UI.Calendar in MasterPage (ASP.NET 2.0)

UPDATE: Using Popup ASP.NET Calendar in MasterPage (ASP.NET 2.0)

Yahoo.UI.Calendar in BasePage and MasterPage

Introduction

This article is a part II of my previous article “Using ASP.NET Calendar and Yahoo.UI.Calendar in ASP.NET 1.1“.As you all know, I have shown very simple way of using those calendar controls in ASP.NET 1.1 Project in my previous article. However, I got some mails that they has some problems in using Yahoo.UI.Calendar from Master Page or Base Page in their project. So, I started writing this part II for those who has problems.

In this article, I’m gonna show you how to use Yahoo.UI.Calendar in BasePage (ASP.NET 1.1) and Master Page (ASP.NET). I’d suggest you to download the sample projects before start reading the rest of this article.

NOTE: I won’t cover anything about using ASP.NET Calender in BasePage since no one seems like no interest for using this control in their project. UPDATE I have uploaded a sample for using Popup ASP.NET Calendar in Master Page. So, You may download it from here and Also, I assume that you already know what BasePage/Master Page is and how it does.

Using Yahoo.UI.Calendar in BasePage (Page Template) (ASP.NET 1.1)

Let’s take a look ASP.NET 1.1 Project firstly.

The following files will be included in that project.

  • [Controls]
    • WebForm1Control.ascx
  • [CSS]
    • [CSS files.....]
  • [Images]
  • [JS]
  • BasePage.cs
  • WebForm1.aspx
CSS, Images and JS No modification required except pdate.gif under Images Folder.
BasePage.cs
Master Page. This class is inherited from System.Web.UI.Page. (As there is no master
page in ASP.NET 1.1, the custom class need to be created to act like Master
Page.)
WebForm1.aspx
a web page which is inherited from BasePage
WebForm1Control.ascx
a User Control that support to be attached to the placeholder of BasePage.

As we all know that there is no master page in ASP.NET 1.1, we have to create a custom class called BasePage that can be inherited from other content pages. If you take a look at Basepage, you will see a public function called AddCalendar. In this function, I wrote the same code that we used in my previous article.

Lab1: How to add this code in your owned project.

Note: As there are a lot of way to create BasePage or Page Template in ASP.NET 1.1, I can’t say that the way that I used to create a basepage will be as same as yours. So, It’s better if you check whether we are in the way or not. If it’s the same, free free you can see my coding without any modification. If not, you might need to modify a lit bit. In case you are not able to modify the coding to match with your basepage, leave a comment what problem you are getting. I will try to help you as much as I can. but I won’t say that would be so quick because I have so much troubles in internet. Anyway, All I can say now is that I will reply as soon as possible.

1. Copy CSS files, Javascript files and Images to your project

2. Copy the required coding from BasePage. eg: AddCalendar Functions. Here again. I can’t say that which coding you should copy from my basepage because I’m not sure about your existing coding for base page.

3. Add the following coding in your WebForm.

base.AddCalendar();

4. Add the following coding in your Child Page..

<asp:TextBox id="txtDateOfBirth" runat="server"></asp:TextBox>
<A onclick="showCalendar1('<% =txtDateOfBirth.ClientID %>','dateLink1')"
href="javascript:void(null)">
<IMG id="dateLink1" style="MARGIN: 5px; VERTICAL-ALIGN: middle"
src="./Images/pdate.gif" border="0">
</A>

That’s all. How easy it is! :)

Okay. Let’s move on to ASP.NET 2.0 Project.

Using Yahoo.UI.Calendar in Master Page(ASP.NET 2.0)

1. Copy CSS files, Javascript files and Images to your project

2. Add Javascript coding in MasterPage and link to the required CSS and Javascript.

Note:
I would suggest you to double check whether the path of CSS files and Javascript is correct or not. Otherwise, the calendar wont’ be shown in your page. The best way to test is that you can add “alert(‘aa’);” in init() function. This alert should be shown as soon as your page is loaded.

3. Add a DIV called cal1Container in your Master Page. This DIV is a placeholder where Yahoo.UI.Calendar suppose to be attached. You should also note that you can set higher value to Z-ORDER in case this calendar is showing behind the other controls.

<div id="cal1Container" style="position: absolute; display: none;"/>

4. Add the following coding in your User Control.

<asp:TextBox id="txtDateOfBirth" runat="server"></asp:TextBox>
<A onclick="showCalendar1('<% =txtDateOfBirth.ClientID %>','dateLink1')"
href="javascript:void(null)">
<IMG id="dateLink1" style="MARGIN: 5px; VERTICAL-ALIGN: middle"
src="./Images/pdate.gif" border="0">
</A>

That’s. Now, you can start running your project and check whether Yahoo.UI.Calendar shows properly in your page or not.

Hopefully, you may find it useful.
Thanks.

[Funny] What kids think about marriage

Hey guys, Very boring??

Let me show you very nice post from this blog.

Here are some Q&As that I took out from original post. [All credits goes to him for finding this.]

WHAT DO YOU THINK YOUR MOM AND DAD HAVE IN COMMON?

Both don’t want any more kids.
– Lori, age 8

WHAT DO MOST PEOPLE DO ON A DATE?

On the first date, they just tell each other lies and that usually
gets them interested enough to go for a second date.
– Martin, age 10

IS IT BETTER TO BE SINGLE OR MARRIED?

It’s better for girls to be single but not for boys. Boys need
someone to clean up after them
– Anita, age 9

HOW WOULD YOU MAKE A MARRIAGE WORK?
Tell your wife that she looks pretty, even if she looks like a truck.
– Ricky, age 10

Have Fun! :)

MSFirefox or IE7?

Did u know that?

I came to know a web site called MSFirefox today.

logo.PNG

I’m wondering if Microsoft really made that product and this website because there are a lot of things which are very very strange to me.

1. Smiling Bill Gates Photo at the left banner.

smiling-bills.PNG

2. The one they are giving as download is IE7-WindowsXP-x86-enu.exe

This is the installer for Internet Explorer 7.

3. It’s not FREE

30$?

4. The definition of RSS in Full Features Page or this page.

RSS means … Arh! .. Better go and check it out.

If you wanna read more, you may chk their support page.

5. Strange Photo in 4th Feature “Fast Fun” which is mentioned in Home Page.

That girl from this photo looks very like one of the porn stars from Japan. (but not sure.)

Yeah. Maybe there are some more but let me stop here.

I just assume that this website might be created by someone who hate Microsoft. Let me know if you guys have any idea about this site.

Opps! Almost forget.. Here is a movie from their site..

Vote for ME

My friend “Ashish C” and Me are running a competiton to find the best extensions for Firefox 2.

The Rules were:

  1. Each of us will nominate 3 extensions via email.
  2. We will post up both of our nominations on our blog.
  3. Our readers and commentators will vote on the Best extension among our choices.
  4. Voters have until 26th November (12:00 AM GMT) to vote for the best extension.
  5. Winners will be announced on 27th November by counting votes on both blogs.
  6. To make this competition fair we decided not to nominate any of the featured or well known extensions such as AdBlock Plus, Performancing etc.

Ashish C.’s Nomination list:

Translator Translator is web translation extension that allows
you to translate web pages into many of different languages at the click of a button. (The button’s on the lower-right corner of the screen on the status bar.)
   
MediaPlayerConnectivity Allow you to launch embed video of website in an external application with a simple click.
   
Googlepedia Shows you a relevant Wikipedia article along with your search results. Clicking links in the article will trigger new Google searches, making it a very useful research tool.

Note: You may also read from his post.

Michael Sync’s (Me) Nomination List:

DownloadHelper DownloadHelper is a tool for downloading Embeded Video from any website to your harddisk.

More Info:If you wanna know more about this extension, you may read it from my post “Downloading Flash File using DownloadHelper”

   
TestGen4Web TestGen4Web is a tool to record/replay user actions in
Firefox. (This extension is developed by Spikesource, a company making a name for themselves by testing Open Source applications. ) As it acts like Macro-recording in automation testing tools, this extension can be used for testing web application.

More Info: I also wrote about this extension in this post “TestGen4Web, Free Website Testing Tool”.

   
Firebug FireBug lets you explore the far corners of the DOM by keyboard or mouse. All of the tools you need to poke, prod, and monitor your JavaScript, CSS, HTML and Ajax are brought together into one seamless experience, including a debugger, error console, command line, and a variety of fun inspectors.

More Info: You may read about this extension in details from this link “Firebug, Javascript Debugger“.

Okay. That’s all. :-) I have selected three extensions that I think they are the best from a lot of other Firefox Extensions. I also wrote about each extension in details.

So, What do you think? :-) Feel free to let us know your idea. Vote for us!And As Ash says, Let the best man wins!

BTW, When I was looking for the best extensions, I found some cool extensions that I like. I will post about those extensions too during this week.

Thanks and Regards,
Mike

TestGen4Web, Free Website Testing Tool

Introduction

TestGen4Web is a tool to record/replay user actions in Firefox. (This extension is developed by Spikesource, a company making a name for themselves by testing Open Source applications. ) As it acts like Macro-recording in automation testing tools, this extension can be used for testing web application.

You can record all actions very easily by pressing the “record” button Record Button which is shown in Toolbar. Once you are finished recording, you can save all steps in XML file for replaying later. [Note: You are able to edit the XML file as you want after saving. ]

As the steps is saved in XML file, you can use either TestGen4Web or Other Automation Web Testing Tools such as HttpUnit, SimpleTest and so on.

There are two parts in this extension. There are ~

  1. Recorder : It uses in recording user actions in Firefox.
  2. Translator : Translator framework is a collection of translators written in any language. The translator needs to take one or more input files, and output the automation tests, and the driver to run the test.

Please take a look at the overall picture of TestGen4Web

Overall picture of TestGen4Web

Where can I get it?

You can get it from Firefox Addon Website. Here is the direct link. You will see new toolbar for TestGen4Web after installing. (Note: Restarting the browser is required as usual).

HOW-TO?

Yeah. I wanna tell you in details. Unfortunely, I have very limited time to wrtie the whole things. I’m gonna share some good links where you can read.

Links

  1. Website testing with TestGen4Web and Firefox
  2. Projects:TestGen4Web
  3. Screenshots
  4. Documentations
  5. Download Links
    1. Download from Firefox Addon.
    2. Download from SpikeSource.

Hopefully, you will find it useful.
Feel free to leave a msg if you have something to say or wanna suggest me something good. I do appreciated for that.

If you wanna thank me for that post, please vote for me here.

Thanks for reading and your vote. :)