Posts

Showing posts from 2008

Invalid postback or callback argument of ASP.NET

Today I found this error when I start debug my code. I have never seen it before. Therefore I suspected that the problem is that I removed the Google Adsense block programatically in my debug environment. The problem is, the error only happens in IE 7. In Firefox 3.0 it works fine. I then suspect the error comes from the debug environment. I turned off the Debug="true" in my web.config. The same error happens. The real bad thing is, I opened the hosted website using IE 7 and the same error appears. This means all my visitors will got this error if they browse my web pages using IE7 and click certain radio buttons. This is pretty serious now. After more investigation, I found a few good posts. nvalid Postback or Callback Argument Error in ASP.NET 2.0 And this post leads to really good analysis. ASP.NET Event Validation and “Invalid Callback Or Postback Argument” : Part I ASP.NET Event Validation and “Invalid Callback Or Postback Argument” : Part II Event Validation Errors and ...

Debug Error with Google Adsense Code

After I embedded the Google AdSense code in my web pages and started to debug my website using Visual Studio Express 2005, I got the following error, Microsoft JScript runtime error: Error in loading DLL The line of code is in Show_ads.js: {var b=c.GetVariable("$version").split(" ")[1];return b. According to other posts online, I suspect that the problem is the domain name I am using for my development environment. The full URL becomes "http://localhost:59517/Default.aspx". However, I could not find the option to set the domain name for debug using Visual Studio. In order to fix the problem, I put all the Google AdSense code in div and added following code to remove the Google AdSense during development stage. It can also ensure I won't click on any ads during my debug. string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (ip == string.Empty || ip == null) { ip = Request.ServerVa...

Google Adsense Approved

Finally, after a few days' hard work to nail down all the HTML/CSS errors and warnings and fix the problems, I resubmitted the Google AdSense application. And fortunately it was approved during my sleep. The approval is quite quick this time, though. Usually I have less than 8 hours' sleep. :) I am happy that the website is much more cleaner now after I validate the pages using W3C Markup Validation Service and CSS Validation Service.

Javascript Escape/UnEscape and C# UrlEncode/UrlDecode, Encode/decode

In Javascript I use following code to get the input of user name: sUserName=escape($get('ctl00_SampleContent_TextBox_Name').value); In order to display this string to user using C#, the following code is used: System.Text.StringBuilder strMessageBody = new StringBuilder(); strMessageBody.Append("Hi "); strMessageBody.Append(HttpContext.Current.Server.UrlDecode(sUserName)); strMessageBody.Append(": "); strMessageBody.Append("Thanks for ....");

Please Validate Website Before Applying For Google Adsense Account

After about one year's development, I finally uploaded my website to a web host and make it live. I tested my website for a couple of month and noticed that there are about 2oo pages are cached by google and everything looks OK, then I submit my application for Google Adsense. Unfortunately I was rejected. The following is the email. ====================================== Hello, Thank you for your interest in Google AdSense. Unfortunately, after reviewing your application, we're unable to accept you into Google AdSense at this time. We did not approve your application for the reasons listed below. Issues: - Under construction --------------------- Further detail: Under construction: We've found that your site’s pages are incomplete or under construction. We require websites to be launched and navigable before being considered for AdSense. Your site must also contain enough content for our specialists to review, and to display relevant ads. Once the majority of your site is ...

Create a website using Visual Studio 2005 Express

As a professional .Net developer, I do have access for MS Visual Studio tools from version 2001 to 2008. However, I choose to using Visual Studio express version to develop my personal website in order to avoid the license issue. What's more, I believe that VS express can meet my requirement for my website, which is a multi tier Service oriented .Net web application. The web site supports both SQL Server and MySQl through a data access tier, which is class library developed using Visual C# express 2005. The class library is consumed by Asp.Net application developed using Visual Web Express 2005 and parked at a sub domain with a sole goal to provide service to my main Asp.Net application. Another class library is then developed to provide an API that provide all functions to make use of the web service. And my main .Net application is build on top of the We Service API. So I could make use of the VS Express 2005 tools to generate a complete, AJAX rich ASP.Net application very c...