This was really my problem wayback I starting learning AJAX. I cannot figure it out on how to add AJAX capability if I already have an existing website. One solution I remember at that time is I created an AJAX enabled website and transfer all my work there. Quite a tedious task, but that's what I really did! Anyway, as a benefits for others so that they will learn from my lesson, you don't really need to transfer your work, all you need is a bit of referencing, and additional configuration to your web.config file. And that's it, you can now use your UpdatePanel independently per page.
Here how it goes:
1.) Add a reference of AjaxControlToolkit.dll on your website. After that, you will see that your BIN folder is updated.
2.) Next, add <controls> tag under your <system.web> node. Here is the code:
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
3.) That's it. But if you are getting an error and if you still experience a postback on your page. Just add this addition tag/node under your <system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
That's it, your website must be fully working and functional using the power of AJAX!
// Willy David Jr
I was doing an online job application this week when I encounter this problem. I can create Modal pop-up window using BLOCKED SCRIPT
myLinkButton.Attributes.Add("onclick", "BLOCKED SCRIPTwindow.showModalDialog('http://" + myUrl + "')");
Everything works fine, because the user cannot navigate to any other page unless he/she closes the window first. Until one thing, when he presses or click the Submit button of the modal popup, another window opens, the same window and URL I used on my modal pop-up. The problem was, you cannot make a postback inside a modal pop-up window. It will just trigger the same problem as I does.
Anyhow, we are already on information age, and I found one very good solution to this, create a new web form page, put a frame control on the page, and link that frame control to your modal pop-up window. Here is the code for my FrameApplicationForm.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrameApplicationForm.aspx.cs" Inherits="Portals_0_Skins_GurangoSkin_MainUserControls_FrameApplicationForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<HEAD>
<TITLE>Online JOB Application</TITLE>
</HEAD>
<frameset rows="100%">
<frame name="mainframe" src="ApplicationForm.aspx" bordercolor="0" title="Navigation bar"> <--- Link your modal pop-up window here
</frameset>
</html>
The on the javascript declaration, use the url of this frame application form page:
string myURLforFrameApplicationPage= "~/FrameApplicationForm.aspx";
myLinkButton.Attributes.Add("onclick", "javascript : window.showModalDialog('http://" + myURLforFrameApplicationPage+ "')");
Now everything works fine, and I can now proceed to my next task! :)
// Willy David Jr
Since yesterday, I am having problem creating a Session State in a Web Service. First the session creates a unique ID everytime you invoke the method. Second you need to tell the web service method that you will use session state. I've seen a lot of example out there, but I am having trouble increment the hits of my web service method. I think there is a problem with their code. So here's what I did:
1.) First Create the Web Methods. Make sure your set the EnableSession to true:
(One is to get the value of the session changed, the second one is to change the session value as parameter)
[WebMethod(EnableSession = true)]
public object getsession()
{
return Session["MySession"];
}
[WebMethod(EnableSession = true)]
public void changesession(object val)
{
Session["MySession"] = val;
So how do you consume this web methods and use session at the same time on web service? First create a cookie that will be your ID for your service, then put this cookie on a session, so that whenever you will need this cookie with the same ID for your web service session, you can just call the session name. Here is an example:
localhost.Service myService; //declare your web service variable
protected void Button1_Click(object sender, EventArgs e)
{
System.Net.CookieContainer cookies = new System.Net.CookieContainer(); //declare your cookie as your ID for your Session's web service
object x;
Session["MyCookie"] = cookies; //put the cookie on a Session
if (myService == null)
{
myService = new localhost.Service();
myService.CookieContainer = (System.Net.CookieContainer)Session["MyCookie"]; //declare your CookieContainer for your service which is in your Session, which you can always call
Session["MySession"] = "Hello World" ;
myService.changesession(Session["MySession"]); //change your Session value on your web service method which is saved on your unique CookieContainer
}
protected void Button2_Click(object sender, EventArgs e)
{
if (myService == null)
{
myService = new localhost.Service();
myService.CookieContainer=(System.Net.CookieContainer)Session["MyCookie"]; //declare your CookieContainer again which is in your Session, this CookieContainer should have specific value
Session["MySession"] = myService.getsession(); //retrieve the value of your Session value on your web service method
}
It was first confusing, but with little practice and applying it in a mock-up application, you can understand the logic behind declaring a Session inside a web service which is important for methods that needs the theory behind it.
Why is it one of the best day in Microsoft? Yesterday, June 07, 2008, was one my best day I ever had in Microsoft. I never thought that would be that fun and exciting. Though one week before that, I thought I couldn’t make it because I have an appointment on my doctor, and have scheduled my gym during weekends at Fitness First Alabang, I rather chose to be on Microsoft and take aside all my appointments.
How did the story begins? Let’s take my story a year before my graduation. I started to be as part of Microsoft Student Partners last August 2, 2007. It was my first meeting invitation from Ms. Tin. I thought the email I received was an accident because I was still on the process of applying for MSP, but Ms. Tin verified that I was included on the list, so I came on the meeting. By the way, I knew MSP program since the Imagine Cup competition. We where one of the top 5 finalist all over Philippines, and all MSPs where there and I thought that after this competition, I would try MSP too. And that how the story begins.
How’s life being an MSP? Well being an MSP is different as being a student, and a whole lot different on being an employee. First, you don’t earn money as an MSP, though it will makes sense if you apply for an employer and they will hear you’ve been part of Microsoft for a year. As an MSP, you don’t just bring your school name in Microsoft, you are also bringing yourself to all students around different Universities and Colleges. My first talk at University of the Philippines, Diliman together with Seco was one of my challenging task I’ve had. Challenging because it will be my first talk and demo on a different University. Usually, I am calm and I love to demo on my own University because I knew my classmates well, but on a different perpective, that is another way around. It was fund and exciting, and you just don’t talk, you are bonding with people, so much that I bond with MSP.
How about MSP people? Every MSP I met is supportive. It was not kind of a thing I thought that wasn’t. That was passion is made from every part of the student on the group. And that’s how MSP are different. And lastly, the bonding activity you will experience with MSP after an event or demo. The videoke part was one of my favorite.
So how this graduation goes? As I said, I can’t describe how happy I am with these people and as the graduation goes, I was awarded as best programmer/code of the year (MSPs correct me if I’m wrong, that’s how I remember it). I never expect that award but I am very thankful to them because I received it. And as the program goes, it was full of fun and laughter, and every game was cool and exciting. We received our recognition/certification as being an MSP of 2008, and a jacket of MSDN. Wow, this jacket is pretty cool than the one I received a year ago. The planning was quite tough but I bet it will be a more challenging one for this year, I hope I can help achieve this plan. After that, we have a good dinner, before everybody goes home. I am tired, but on the bus, I still remember the jokes of everyone, I remember my crush on MSP which is Cha, I remember all the past memories I’ve been as MSP, I remember every good memories I’ve been with them, I remember that this will be one my best day in Microsoft! 
We are doing some project in ASP.NET when we just encounter this error a while ago.
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. D:\Basti\SMM_051908\SMM\SMM_Design_052308\SMM Design\web.config 23
I've encountered this a couple a times and I found this steps as my solution.
1.) Try to move the backup copy of your application. Sometimes, you have some backup copy like on my error above. It was a backup copy of my running solution. Try to move it on a different folder or some other location then build your current project.
2.) Try to check if your default web site in IIS is pointing to the correct NET framework version.
3.) Try to copy your latest project then move it on another folder.
Number one steps seems to be working for me. But try the steps in number two or three because I tried them before I finally used the number one step.
// Willy David Jr

Consuming simple web service and understanding web service is a little bit difficult at first. It takes some time to understand the theory behind it. In my part, reading will be a good start. Read some articles and basics behind it. But as you move along, consuming will just be a basic part. You need to extend your web service so that it can be used by other application if not from your local, it can be a network, or in the internet.
On this simple article I've created, we will create a simple web service and use it on a local area network. Here are the steps:
1.) Create your web service in your VS 2005 environment, I prefer File - New - Web Site. Then choose ASP.NET Web Service template. Make sure you choose HTTP as your location.
2.) Create your web methods. Sample code below:
[WebMethod]public int Add(int a, int b)
{
return (a + b);
}
[WebMethod]public System.Single Subtract(System.Single A, System.Single B)
{
return (A - B);
}
3.) Add a web config file. Add these nodes after system.web so that you can access this web service from a remote machine:
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
If you didn't put this, you will encounter this specific error: "The test form is only available for requests from the local machine" if you accessed this web service from a remote machine.
4.) Lastly, because your web service was running on your IIS, you can now accessed it and consumed your web service. For example, I have this remote machine, and my local machine where I published the above web service has a computer named PH-WWDTWDAVID, then I will just add a web reference like this link:
http://ph-wwdtwdavid/WebService/Service.asmx
5.) To use the code:
int xx;
localhost.Service myService = new localhost.Service();
xx=myService.Add(3, 3);
Response.Write(xx.ToString());
Regards,
Willy David Jr
It was since yesterday that I want to figure out how to start this service in MOSS. I need this in order to start another service to complete my task in Central Administration. But recently, I found a way to fix this one, a simple fix actually. Reinstall your .NET 2.0 Framework. Reinstalling this doesn't just fix this error but also other issues as well like the OK button of Creating a New Web Application doesn't works. Even Cancel button doesn't works. How can you create your portal if this doesn't works. Indeed, some links in Central Administration doesn't works too. This makes me crazy because I need this settings for our test server to work, and I am the one who is assigned to configure it. Luckily, everything now works fine, and I have configured our portals to different users already.
If you want another fix, and if my solution doesn't works, check this site: http://protegeit.blogspot.com/2007/12/document-conversions-launcher-service.html
Regards,
Willy David Jr
My task this few days was to research on how to create comple Web Parts in Sharepoint 2007. Ideally, I create my web parts using code-behind code. In other words, I create the controls dynamically. This was gruesome in my part, because from positioning to event-handlers may take a lot of time, debugging, and most specially in designing. Take a look at my sample code I used to design a very simple web part:
protected override void CreateChildControls()
{
base.CreateChildControls();
// TODO: add custom rendering code here.
Button myButton = new Button();
myButton.Text = "Click";
myButton.Width = 50;
myButton.Height = 50;
myButton.Click += new EventHandler(myButton_Click);
this.Controls.Add(myButton);
}
void myButton_Click(object sender, EventArgs e)
{
//throw new Exception("The method or operation is not implemented.");
myLabelPublic = new Label();
myLabelPublic.Text = "For testing only. For testing only. For testing only.";
this.Controls.Add(myLabelPublic);
}
Basically, this code generate a button on it's page load. After the load, if user clicks the button, obviously, a new Label will generate displaying the message. This is not the way I want to develop my Web Parts, because it takes a lot of time.
So after a long time research, I found another way to create not just simple but you can make it complex using Web User Control. I did suspect Web User Control at the first place but I don't know how to figure it out. Anyway, here are the steps:
1.) First, of course, create your Web User Control. You have the option on how you create it, but in my part, I create it using ASP.NET 2.0 IDE. What I usually did is I create a blank page, then I add a new item which is Web User Control. Take note to uncheck the option which separate your code in a separate file.
2.) Second, design your Web User Control (ascx), from its physical design to its logic coding.
3.) Copy your ascx file to this directory: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES
4.) Then use this sample code as your reference for adding your Web User Control file in your .cs file:
protected override void CreateChildControls()
{
base.CreateChildControls();
// TODO: add custom rendering code here.
this.Controls.Clear();
userControl = (UserControl)this.Page.LoadControl(@"/_controltemplates/Test.ascx");
this.Controls.Add(userControl);
}
protected override void RenderContents(HtmlTextWriter writer)
{
//base.RenderContents(writer);
userControl.RenderControl(writer);
}
5.) Last build then deploy your site. Make sure your output is the URL of your sharepoint site for successful deployment of your Web Part. 
// Willy David Jr
My present project after DotNetNuke was Microsoft Office Sharepoint Server 2007. It was another fun and challenging experience on my part. I have lots of research and lots of problem to solve. One thing that was a little bit hard on this project was creating web parts. Web parts is a counterpart of modules in DNN. But here, you don't design your Web Parts on a designer just what am I doing in modules. Instead, you either create it in Sharepoint Designer or use template and create one from there.
In using template, after creating your code, build your project of course, and according to Microsoft's link: http://msdn2.microsoft.com/en-us/library/ms948909.aspx and some other links, deploying was as easy as pressing F5. But I always got this error message: "No SharePoint Site exists at the specified URL". It was kind confusing because I did every configuration I need to set but it was all nothing. Then what I did is instead of putting the actual URL of my sharepoint site to the Build -> Output Path, I instead define my URL at Debug -> Start Action -> Start Browser with URL . And rebuild then deployed my project. Now everything works fine. 
It was a normal day yesterday and as I entered my house, I saw this large envelope and and I knew that was from Microsoft. At last, I received my Certificate of Excellence as Microsoft Certified Technology Specialist .NET 2.0 Web Applications. After more than 2 years of hardwork and patience, at last, it was paid off. It took me almost 2 years before I took the second core exam which is 070-528. It was hard and it needs me more time to study while working. But it was a little bit easy because the experiece I've got from my current company (Gurango Software Corporation). I never knew that I will be a Web Developer there because when I was still intern, we task to do something which will determine if what department we wil be deployed. But thank GOD, I was deployed on the Web Development area.
Well, receiving this is a big hope for another certification. A hope to increase more my knowledge about Microsoft technologies. I hope I received my wallet card as soon as possible. I want to know what it looks like.
// Willy David Jr
MCP ID: 3804375
Creating Web Parts in ASP.NET 2.0 is one of the cooling thing I've ever seen in ASP.NET 2.0. I don't know if it was a new feature in 2.0 for ASP but it was nice development control for me. I think it was the same implementation with DotNetNuke modules, where modules where added to the site one by one and you can control it's appearance and where you want your modules to reside. The same way goes with CatalogZone control in ASP.NET. Just add two add CatalogZone in your page, then try to put an image for example to the first CatalogZone and leave blank your second CatalogZone. Before you run the site, don't forget the WebPartManager control to be added on the same page. Then add this code at your Page_Load event handlers:
this
.WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
To disable drag and drop mode for the two catalog zones, change DesignDisplayMode to BrowseDisplayMode.
Then build and run the site. It was cool that you can actually drag and drop the pictures on the two CatalogZone dynamically!
Although it was much cooler if you are using AJAX enabled site where you will not notice any postback from your site.
Cool?
- Willy David Jr
Wow, this was my first blog of the year. But my new year was welcomed by a problem. I have this problem uninstalling .NET framework 2.0. The problem was, that my application I want to install, specifically it was an API from Microsoft Dynamics ver.10. The API cannot detect that I have a 2.0 on my machine but to tell you, I am pretty sure that I have it clean and working. I noticed also that my 2.0 framework installed was a service pack 1 update, that's why I wonder maybe it cannot detect 2.0 because it was already a service pack 1? It makes sense so I try to uninstall .NET Framework 2.0 Service Pack 1, but here is the problem, my machine cannot uninstall .NET Framework 2.0 Service Pack 1 because it always raises another error which says it cannot uninstall the framework because it may affect other program which uses it. Arrg, it may use other program, but I want to uninstall it temporarily to give way to my API. A
After a couple of hours, searching the net, I found nothing. It may have the same problem but their solution doesn't work on my part. So what I did is this, I tried to uninstall first my .NET Framework 3.5, then 3.0. Well, it was a risk because I am also using those framework, then tried to uninstall 2.0 Service Pack 1. With a twist of luck, it was a success.
Maybe Microsoft should put this on their database support files
. They have some links when I've got those error messages but when I check the link, it was not a good help because their link was blank.
- Willy David Jr
One of my task last week was to send mass email to customers using web forms. And this was the first time I will create this type of project: The Email System of ASP.NET 2.0. And because of large information around the web, it didn't took me too long hours to finish it, it just need some tweaks. So I want it to publish it under my blog for others to see, and also to learn if there are other way to do this. Take note, I tried to create my own email address, and it works! Wonderful, however, you cannot reply to the email address I've created, it will return a daemon error / failure notice . I wonder this is the way the spammers use to send spams. They will just include their real email address in the body of the message. Cool isn't it?
Under your webconfig file, add additional nodes:
<system.net>
<
mailSettings><smtp><network host="SMTP.BIZMAIL.YAHOO.COM" userName="wdavid@gurango.com" password="******" />
</
smtp></mailSettings>
</
system.net>
<----------Business logic here ---------------------->
//Code starts here, we access the webconfig here
System.Configuration.
Configuration myConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);System.Net.Configuration.MailSettingsSectionGroup mySettings = ((System.Net.Configuration.MailSettingsSectionGroup)myConfig.GetSectionGroup("system.net/mailSettings"));
//Obtain credentials from web.config file under mailsettings node
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential(mySettings.Smtp.Network.UserName, mySettings.Smtp.Network.Password);
//Create an SMTP client here, can be found on account settings in outlookSystem.Net.Mail.SmtpClient myClient = new System.Net.Mail.SmtpClient();
myClient.Host = mySettings.Smtp.Network.Host;
myClient.Credentials = myCredential;
//Build email message here:
//MailMessage myEmail = new MailMessage();System.Net.Mail.MailMessage myEmail=new System.Net.Mail.MailMessage();
myEmail.From =
new System.Net.Mail.MailAddress("willydavidjr@david.com");myEmail.To.Add("willydavidjr@yahoo.com");
myEmail.Subject =
"Test Mail";myEmail.IsBodyHtml = true;
myEmail.DeliveryNotificationOptions = System.Net.Mail.
DeliveryNotificationOptions.OnFailure;myEmail.Body = "<strong>Hello World!</strong>";
myClient.Send(myEmail);
Cool? What do you think guys? Or am I just a newbie here? 
It was a cool but tiring week for me last week. Our sites, modules, and our API were ready for RTM so I was assigned for creating an installer. I never tried the click once deployment and even creating an installer for instance. And I was assigned to create it for deployment, so we used InstallShield as our main framework for creating it. At first, my first impression was Wow! It was pretty cool but pretty tough. It was like creating a program using structure programming language which I was not familiar anymore. But as I go with the program and orientation, it was a pretty cool task. Although I really need to review and research a lot of things like how can you specify on the installer the inputs that will be made by the user and use those inputs for creating a file for connections strings on your XML file and other config file. You also need to use those inputs to check if a database exists and check for username and password. Indeed it was pretty tough but learning from new programs like these was a great experience. It was like shifting from OOP to Structure then back to OOP again. The experience was there and the attitude towards work gives me an improvement not to give up if there where cases that seems impossible. I think I was learning the hard but cool way.
How about you? What installer do you use? I think I can create an installer too using VS 2005 because some other teams in my workplace do use VS 2005 for creating an installer and an API for code reuse.
- Willy David Jr
This was a little bit late. But I still value this video because this was my first presentation in other University. We conducted it on University of the Philippines, Diliman as part of Microsoft Student Partners' agenda to introduce and promote Microsoft Development tools and technologies like the one we've discussed (ASP.NET and AJAX). Athough not of all students/attendees are not so techie, the presentation worked smoothly. You can check the link of the video at My First Presentation Demo . It was fun and we enjoyed it from preparation up to the presentation although we are busy with schooling and work, overall, it was all paid off! 
More Posts
Next page »