Pages

Search This Blog

Sunday, August 17, 2008

Thank You

Thanks For your support!

TextArea Newline

Even wonder how to construct a new in TextArea? Many try to use <BR>
and /n but both doestn't work for me. But this &#10; work for me. Forget to mention, i'm using IE7 when do the testing. I'm not sure whether this is browser dependent.

Tuesday, August 12, 2008

ASP.NET: colon in querystring cause error "is not a valid virtual path."

Server Error in '/' Application.
'~/Search.aspx?pageidx=1&Id=:' is not a valid virtual path.


Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: '~/Search.aspx?pageidx=1&Id=:' is not a valid virtual path.


Understand that in asp.net, virtual path in the URL with colon (:) is not allowed. To solve this problem, i replace the colon (:) with ASCII value for colon &#58; (please check http://www.asciitable.com/) and HttpUtility.UrlEncode on the search key before pass into search.aspx as querystring.

In Search.aspx.cs, do HttpUtility.UrlDecode and pass to DB for searching purposes. Problem solve. Bear in mind that you might need to disable the ValidateRequest (ValidateRequest="false") which may open for dangerous hijack/request.

Monday, August 11, 2008

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Server Error in '/xxxxx' Application.

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.            

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the
error and where it originated in the code.

Exception Details: System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Source Error:

Line 89: <%# if (Eval("UserId").ToString().Length != 0) {%>


googling around and not able to find a solution. What i do is i put the if/else condition into a function and pass in UserId as parameter and output the desire output string.

now my line 89: become <%# FormatRatedDisplay(Eval("UserId").ToString())%> and new function FormatRatedDisplay will return a string. I issue solved.

Thursday, August 7, 2008

Microsoft .Net Framework TPM - Virus

My antivirus detect a new virus and some file has been deleted but there is a pop up windows keep on showing up and say that "procedure not found". After check around, i found something strange in windows services

Service name: bjvhrz
Display name: bjvhrz
Description: Microsoft .NET Framework TPM
Path to executable: C:\WINDOWS\system32\svchost.exe -k bjvhrz



I'm not able to stop and to disabled it.



To solve it,
  1. Disable System Restore
  2. Back up registry
  3. Restart in Safe Mode
  4. Open Registry Editor. Click Start>Run, type REGEDIT, then press Enter.
  5. In the left panel, double-click the following:
    HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Services
  6. Still in the left panel, locate and delete the key:
    bjvhrz
  7. Close Registry Editor.