If you are dealing with Chinese characters in English environment like me, you will come across some issues with Chinese characters, such as it becomes symbols or lots of question marks (??????) after retrieving. Here’s the solution on “question marks” issue when issuing “SELECT” SQL statements.
[Read more →]
One of the advantages of using DataList is that it provide rich format for each row easily. I had been a while since my last development on ASP.Net. One of my readers asked me how to pass the value from rows in which user selected after pressing a button. I then fired up Visual Studio [...]
[Read more →]
I am not a vegetarian but I like to go to vegetarian shops for lunch during weekday. Reasons are it is healthier (to control my cholesterol and liver index) and I am less likely to fall asleep in the afternoon if I took it. However, I found that it is difficult to know when is [...]
[Read more →]
Today I had been buzzed with a bug in WordPress 2.6. That is, one of my posts cannot be loaded when trying to edit it. The page only shows some headers and the rest is empty. As a result, I can’t edit the post. Checked error log and I found this fatal error:
[error] PHP Fatal [...]
[Read more →]
On Windows XP, after installing Apache HTTP Server 2.2.4, PHP 5.2.2, and MySQL Community Edition 5.0.37, I downloaded Zen Cart – an open-source PHP e-commerce web application as my friend is asking whether I can develop one for her. I encountered a database not supported error when installing it. After searching through Internet, eventually I [...]
[Read more →]
After letting ASP.Net Web Administration configured my web.config. I received “sys is undefined” error on the page whenever there is AJAX control on the page. There is nothing wrong with the code. All you need to do is to ensure the following statements exist in web.config:
<location path=”ScriptResource.axd”>
<system.web>
<authorization>
<allow users=”*”/>
</authorization>
</system.web>
</location>
<add verb=”GET” path=”ScriptResource.axd” type=”Microsoft.Web.Handlers.ScriptResourceHandler” validate=”false”/#62
Here is the related [...]
[Read more →]
Create an asp:button namely “button1″.
On codebehind page, add the following:
private void Page_Load(object sender, System.EventArgs e)
{
button1.Attributes.Add(“onclick”, “jsFunc()”);
}
in which “jsFunc” is the JavaScript function you define in aspx page. With this, whenever button1 is clicked, “jsFunc” is called at client side.
[Read more →]
Reference: http://forums.asp.net/1072828/ShowPost.aspx
Because DataList is databound control which repeats its item template as many times as there are rows in the data source to it. Therefore contents of template are wrapped into DataList’s Items (one DataList item per row in data source) which is a naming container to its contents (to keep control ID naming scope [...]
[Read more →]
Normally we use to Eval method to print out value retrieved from database to HTML. For example:
asp:Label id=”lblDate” runat=”server” value=’<%# Eval(myDr["DateAdded"]) >’
Assuming “DateAdded” is a date/time field in database, the above statement returns a date/time value from database.
Now, if you would like to show only date portion of it. You should define format string within [...]
[Read more →]
In case you still didn’t aware, there is no FOR loop in Transact-SQL (T-SQL). Anyway, you can replace it with WHILE loop, such as:
DECLARE @i int
WHILE(@i < 5)
BEGIN
– do whatever you want here –
SET @i = @i + 1
END
Remember to increment/decrement the counter. Else, you will ended up in infinite loop.
[Read more →]