Search This Blog

Thursday, August 30, 2007

'System.Web.UI.UpdatePanel' does not have a public property named 'table'

I've received a error message "System.Web.UI.UpdatePanel' does not have a public property named 'table'" when trying to use AJAX.NET.

The code:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>

</table>
</ContentTemplate>
</asp:UpdatePanel>

After surf for a while, i found the solution on this issue. We need to put <ContentTemplate> <table> ... </table> </ContentTemplate>

This solve the problem.

How to add Del.icio.us, Digg, Technorati etc to Blogger

How to add bookmark to your Blogger?

To include the bookmark link below each post, select 'Template' --> 'Edit HTML', then copy-and-paste the code below into the template, right after the <div class="'post-footer'"> tag. Note: be sure to check the 'Expand Widget Templates' checkbox first. When you are done, click 'Save Template'.



del.icio.us

<a href="http://del.icio.us/post?url=<$BlogItemPermalinkURL$>&title=<$BlogItemTitle$>">Del.icio.us</a>

Digg
<a href="http://digg.com/submit?phase=2&url=<$BlogItemPermalinkURL$>">Digg</a>

Technorati
<a href="http://technorati.com/cosmos/search.html?url=<$BlogItemPermalinkURL$>">Technorati</a>

Blinklist
<a href="http://blinklist.com/index.php?Action=Blink/addblink.php&Description=<$BlogItemTitle$>&url=<$BlogItemPermalinkURL$>">Blinklist</a>
Furl
<a href="http://furl.net/storeIt.jsp?t=<$BlogItemTitle$>&u=<$BlogItemPermalinkURL$>">Furl</a>

reddit
<a href="http://reddit.com/submit?url=<$BlogItemPermalinkURL$>&title=<$BlogItemTitle$<"<reddit</a>

Newsvine
<a href="http://www.newsvine.com/_tools/seed&save?u=<$BlogItemPermalinkURL$>&h=<$BlogItemTitle$>">Newsvine</a>

Credit give to ExplodingBoy

Wednesday, August 29, 2007

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client xxxxxx

Sometime we will received error message:

System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client xxxxxxx ..........

Normally what a developer do:

  1. Change <%@ Page ... validateRequest="true" %> to <%@ Page ... validateRequest="false" %>

  2. Change default in the web.config: from <system.web><validaterequest="true"></system.web> to <system.web>< validaterequest="false"></system.web>

This can prevent the error message shown but not actually not solving the problem. Let's continue discuss on what i mean. Usage for validateRequest="true" <%@ Page ... validateRequest="false" %><system.web>
validateRequest is useful to protect the script injection.

Lets take a simple application for current discussion:

A simple application with
ValidateRequest="true"



Containing a textbox, a button and a lable.



Once click on the button, the label will take the text from the textbox



Enter Good Day! and click on the button. Below result shown.



When enter <script>alert("Good Day!")</ script> and click on the button, error message below shown.
"A potentially dangerous Request.Form value was detected from the client (TextBox1="<script>alert("Good ..."). "
This is because user try to enter a script to ASP.NET input that can harmful to the application.



To make sure we didn't see this error message, we can change ValidateRequest="true" to ValidateRequest="false" but bear in mind that this may be dangerous to our application.

The script will be executed. If these script entered is harmful, then it will dangerous to our application and system.



The recommeded way is set ValidateRequest="true" and HTMLEncode the input.



Below result will be shown.



Please let me know whether this is helpful.


Tuesday, August 28, 2007

Javascript Drag & Drop

It's pretty interesting to visit a website or a web application with drag and drop function like Blogger, EncelabsCRM. Very user friendly and impressive. After surf around on how to do that, i found that there are some free UI library ready to be used complete with documentation. Yahoo UI library, mootools and etc. Go to play around and maybe you will get benefits from there.

Friday, August 24, 2007

Auto-attach to process '[3716] aspnet_wp.exe' on machine 'xxx' failed. Error code 0x8013134b. The project is not configured to be debugged

i got a error message "Auto-attach to process '[3716] aspnet_wp.exe' on machine 'xxx' failed. Error code 0x8013134b. The project is not configured to be debugged " when i try to debug a downloaded sample source code. My project already has a Web.config file, and the debug attribute is set to true in the section of the Web.config file

I'm able to solve this problem by set the Execute Permissions for the web folder:
1. Start Internet Services Manager, and then click the project that you are trying to debug.
2. Right-click the project, and then click Properties.
3. Click the Directory tab.
4. If None is selected in the Execute Permissions list, click Scripts only, and then click Apply.

Wednesday, August 22, 2007

virus: myphotos2007.zip - spread via msn messenger

Received a message from a friend in MSN Messenger
"What do you think of this picure? i feel i look ugly :/"
Followed by a attachment in zip format "myphotos2007.zip"
With no suspect, i unzip the file and click on it (file name: DSC515607.jpg-www.pictureland.com). Nothing happen and after a while, MSN messenger windows keep on appear and disappear, i know something is not right. Quickly logoff.
First thing i do is scan with nortan antivirus but found nothing. I try to go to other antivirus website like trendmicro, Kaspersky and etc but fail (A login required). I know this is infected by the computer virus (worm). (I'm able to go to download a trio version of bitDefender 10, trust me, this antivirus no use - take hours for installation and hours for uninstall and yet fail to uninstall)

Solution:


  • Turn Off System Restore
  • Restart in Safe Mode
  • Go to windows directory, delete delete myphotos2007.zip. (%Windows%\myphotos2007.zip)
  • Go to windows directory, System32 delete newsystem25.dll (%System%\newsystem25.dll)
  • Go to user profile, delete new.txt. 9%UserProfile%\new.txt)
  • Go to run regedit
  • Delete [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad]"prodigy1"="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
  • Delete [HKEY_CLASSES_ROOT\CLSID\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\InProcServer32]@="newsystem25.dll"
After all these step, i still round that i cannot connect to antivirus website. I go to download "Ad-Aware" and install the free version. Scan through my machine. Do some fixes.

Done! Back to normal but bitDefender 10 leave me serious trouble as i'm not able to uninstall it althought i dont want to use it.

Virus name:
Backdoor.Win32.IRCBot.ex (Kaspersky Lab) is also known as: W32.Esbot.B (Symantec), BackDoor.IRC.Sdbot.126 (Doctor Web), Win32.Worm.EsBot.B (SOFTWIN), Worm.ESBot.B (ClamAV), Bck/IRCbot.KG (Panda), Win32/IRCBot.OO (Eset)

Tuesday, August 21, 2007

Display ***** in asp.net TextBox when TextMode = "Password"

The TextBox with TextMode = "Password" will be empty after assign a value using txtPassword.Text = Password
In Order to make it work and display ***** in the TextBox, replace
txtPassword.Text = Password;
with below method. This will work
txtPassword.Attributes.Add("value", Password);

Monday, August 20, 2007

The name 'xxx' does not exist in the current context

When i build my ASP.NET (C#) project in Visual Studio 2005, i got this error message "The name 'Panel2' does not exist in the current context" displayed and the problem is in default.aspx. My code definately have no problem. After debuging and searching for while, i found out the that problem is cause by the back up copy from the same file (copy of default.aspx) that i forget to exclude from the project. The problem solved after i exclude the file from the project.

Sunday, August 19, 2007

Data at the root level is invalid. Line 1, position 1

I'm working on a ASP.Net (C#) project. The web application able to debug and built but when come to publish, error message "Data at the root level is invalid. Line 1, position 1" shown and the error list show that the error occur in page is in web.config. It's kind of confusing. Double click on the error file from the error list, i see message below.

vti_encoding:SRutf8-nl
vti_timelastmodified:TR20 Aug 2007 11:48:12 -0000
vti_extenderversion:SR4.0.2.7802
vti_cacheddtm:TX20 Aug 2007 11:48:12 -0000
vti_filesize:IR6248


After check for a while, i figure it out how to solve this problem. Go to the web project, find a folder name: _vti_cnf

example:
[Project]\_vti_cnf

Delete this folder and recompile again.

I'm able to solve this problem using this way.