Web application Sharing including ASP, ASP.NET 1.0 (C#) AND ASP.NET 2.0 (C#) MS SQL 2005 Server, Life, Travelling
Thursday, August 30, 2007
'System.Web.UI.UpdatePanel' does not have a public property named 'table'
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
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>
<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:
- Change <%@ Page ... validateRequest="true" %> to <%@ Page ... validateRequest="false" %>
- 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
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'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
"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"
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"
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
Sunday, August 19, 2007
Data at the root level is invalid. Line 1, position 1
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.