Tuesday 13 October 2009

"Access is Denied" when working with Process + ASP.NET





  1. Open Control Panel
  2. Open Services
  3. Find IIS Admin Service and right click Properties
  4. Go to Log On Tab
  5. Check "Allow service to interact with desktop"
  6. Click OK
  7. Restart the service(right click, restart)



The solution I found from Microsoft Support here.


Tuesday 29 September 2009

取消煩人的 使用者帳戶控制(User Account Control)

控制台 -> 使用者帳戶 -> 關閉UAC

Control Panel -> User Accounts -> Turn User Account Control on or off

Wednesday 19 August 2009

Silverlight code running order

  1. App.xaml.cs - > Application_Startup
  2. MainPage.xaml.cs -> Mainpage()
  3. Page_loaded event if registered




Thursday 13 August 2009

Developing Flowplayer Flash Plugin environment setup guide

  1. Download JAVA SE , Flex SDK, and ANT if you don't have
    ANT downloaded filename: apache-ant-1.7.1-bin.zip
    Flex SDK downloaded filename: flex_sdk_3.zip
    JAVA SE downloaded filename: jdk-6u16-windows


    Environment Variable:
    JAVA_HOME : C:\Program Files \Java\jdk1.6.0_15
    Path : C:\apache-ant\bin;C:\Program Files (x86)\Java\jdk1.6.0_15\bin
    The folder path is differ depends on your own preference. The above is just my setup

    To check if it's installed, go to Command Prompt and then enter texts like image shown.


    Subversion is needed if you want to get the latest source code from Flowplayer's server.
    Click here to download.(setup the bin folder in Path as well (ex.C:\svn-win32-1.6.3\bin))

  2. To be continued

Saturday 25 July 2009

ASP.NET IIS Firefox authentication required problem



Today, I had problem with running my asp.net project while using Firefox. It asked me to enter username and password to see the page. However, I tried all the passwords and none of them worked. This problem never occurred before, so I googled and finally found the solution.

  1. Enter about:config at firefox address bar. (You will see warning message indicating that these are advanced settings that may affect the browser security and stability)
  2. Click "I'll be care, I promise" button
  3. Search network.automatic-ntlm-auth.trusted-uris at filter. (Only one entry will be appear)
  4. Double click the entry and type localhost.
  5. Save it and reload your web page then DONE!
Here's the original link from ASP.net forum.



Friday 24 July 2009

Accessing Posted Data in ASP.NET

There are two ways to access data using Page.PreviousPage in asp.net

1. Using FindControl function

string username = ((TextBox)PreviousPage.FindControl("tbxUsername")).Text;

2. Using Strongly Typed Data
I personally like this one because I don't care about what the control name is. Also, no typo mistakes will be made.
Here is how to make a strongly typed data

public string UserName
{
get{return tbxUsername.Text;}
}

Also we have to set the code below at the page that receives the posted data.

<%@ PreviousPageType VirtualPath="~/pageName.aspx" %>


Last step, you have to rebuild in order for page to see the property in receiver page.



Wednesday 22 July 2009

ASP.NET CustomValidator with Javascript

To use CustomValidator with client side javascript validation, we need to implement a javascript with two parameters.


function YourFunctionName(source, arguments)



Set property ClientValidationFunction to the name of your javascript at CustomValidator control.

arguments.Value is the data that we will be validated.

arguments.IsValid indicates validation success or failure.

If the validation is passed, we set arguments.IsValid = true. False otherwise.

Tuesday 14 July 2009

Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Last Friday was the official day that Silverlight 3 released. I was about to go home on Friday and don't know why something came to my mind that it's time to check Silverlight's website. Boom! SL 3 is released.


Microsoft® Silverlight™ 3 Tools for Visual Studio 2008 SP1

Saturday 11 July 2009

Using Output Caching to Enhance Web Site Performance

There are 2types of caching for ASP.NET

1. Configuring Page-Level Caching
copy the code below to aspx html source page

<%@ OutputCache Duration="15" VaryByParam="none" %>

Duration means the duration of the cache. In this case, it will cache for 15 seconds.











the name "AppCache1" will be used to the pages that you want to have cache. You can have different kinds of cache options by just adding another profiles like the code below




what we have to do in each of our page is add the code below

<%@ OutputCache CacheProfile="AppCache1" VaryByParam="none" %>

Note: the name of the CacheProfile is the name you set in outputCacheProfiles in web.config.


The attribute VaryByParam is used for caching parameters (eg. querystring) of a page.
example:

<%@ OutputCache Location="Server" Duration="60" VaryByParam="Color" %>


Here we have a param called "Color". (http://mysite/mypage.aspx?Color=red)
When user goes to the page wtih Color=red, it caches the page with param Color=red for specific duration according to our setting.

If we specify the VaryByParam parameter, any new value will be cached. For cached value, it loads data from cache.


Here's the detail explanation of VaryByParam from Microsoft MSDN
==================================
The @ OutputCache directive requires you to set the VaryByParam attribute, which until you now you have set to "none". The VaryByParam attribute enables you to configure caching so that ASP.NET stores different versions of a page depending on parameters such as query strings, form post values, request headers, and so on.

For example, you can use cache parameters in a page that displays weather conditions for select cities, where the weather data is refreshed only every three hours. In this scenario, you want to cache a separate version of the page for each city. You can do so by setting the cache parameter to vary by a query string parameter.
==================================


If you wish to study all the details on your own see here

PDF Split and Merge



PDF Split and Merge is an open source software that allows us to split PDF files into multiple files.

When you installed the program and you see missing javaw.exe, please download Java Virtual Machine

Friday 10 July 2009

Silverlight 3 Element to Element Binding




We don't have to create tons of events for updating values, texts to different controls.

The code below does it all. No additional coding inside cs file.
{Binding Value, Mode=OneWay, ElementName="MyControlxName"}

It's like the old binding style except that we have ElementName to tell the compiler that we want to bind the property to the element MyControlxName's Value property.


Thursday 9 July 2009

ASP.NET Dynamic Compilation

Unlike ASP, ASP.NET doesn't have to compile each and every time it is requested. An ASP.NET page is compiled only once when an application is modified. If it is not modified, the Framework will look for the directory


\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files


to load the compiled dll.


However, if a site contains thousands of pages. Having Framework to precompile everything and store in the temp folder isn't a good choice. Here the way to chose if you want the compiler to precompile or not.
Adding CompilationMode attribute inside the <%@ Page Language="C#" %> tag at html source code view.
The attribute has Always, Auto, and Never. I believe the default is Auto :)



Wednesday 8 July 2009

Friday 3 July 2009

Running PHP in IIS 5.1, IIS7.0

Here's the tutorial link that I followed.

IIS 5.1
Link 1

IIS 7.0
Link 1
Link 2

Sunday 28 June 2009

jQuery Intellisense in VS 2008



Here's the reference on how to have jQuery Intellisense in VS 2008 .
http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx

Easy 5 steps
  1. Go to jQuery site and download the current release and the "Documentation: Visual Studio" link.
  2. Download the patch from Microsoft to allow Intellense in Javascript. Microsoft Site
  3. Include jQuery to your web page as you normally do.
  4. Place the doc file at the place where you place your jquery.js and make sure the file name ends with -vsdoc.js.(Note, the doc file I downloaded was -vsdoc2.js, so I had to remove the "2" from file name.)
  5. Have fun!!

Tuesday 9 June 2009

InvalidOperationException: HtmlPage_NotEnabled

Add this in Page_Loaded
==========================
if (DesignerProperties.GetIsInDesignMode(this))
return;



To avoid this problem, be sure to check if you use HtmlPage class in Page_Loaded.


If inside Page_Loaded you call another functions, make sure they do not call HtmlPage class. Otherwise, use the if statement I provided above.


Reference:
http://www.andybeaulieu.com/Home/tabid/67/EntryID/158/Default.aspx

Monday 6 April 2009

Windows XP 優化

這是一個網站提供了很多的windows xp 的優化

http://www.alan888.com/winxp/Optimize.html


其中一個我愛用的是 "自動關閉停止回應程式"
在〔開始〕→〔執行〕→鍵入〔Regedit〕→〔HKEY_CURRENT_USER〕→〔Control Panel〕→〔Desktop〕→將字串值〔AutoEndTasks〕的數值資料更改為〔1〕→重新開機便生效

from alan888

Wednesday 1 April 2009

Windows Live Messenger 8.5 Download

This is for people who doesn't want to use Windows Live Messenger 2009...

---> Multi Language from Microsoft Site

Monday 30 March 2009

Usefull Tools from TrendMicro

SQL Server Management Studio Express
[Checks database's record, query, and etc]

soapUI
[Checks to see if web services returns the right value and etc]

P4V
[Versioning Control tool]

FreeMind
[Easy to make a quick and dirt design diagrams]

Apatar
[drag and drop and convert data]

Saturday 21 March 2009

Windows Server 2003 的一些介紹+ tuning!!

http://www.alan888.com/winxp/win2k3.html