Entries from November 2006

How to find a control in a DataList?

November 30th, 2006 · 2 Comments

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 [...]

[Read more →]

Tags: Programming

Eval method and ASP.Net expression

November 30th, 2006 · No Comments

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 [...]

[Read more →]

Tags: Programming

There is not FOR loop in SQL Server

November 27th, 2006 · No Comments

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 [...]

[Read more →]

Tags: Programming

Cookie with subkeys and ASP:CookieParameter

November 20th, 2006 · No Comments

Cookie with subkeys looks like this: HttpCookie myCookie = new HttpCookie(“MainCookie”); myCookie.Values.Add(“Email”, myDr["Email"].ToString()); myCookie.Values.Add(“User_Id”, myDr["Id"].ToString()); myCookie.Values.Add(“First_Name”, myDr["firstname"].ToString()); myCookie.Values.Add(“Last_Name”, myDr["lastname"].ToString()); myCookie.Expires = DateTime.Now.AddYears(1); Response.Cookies.Add(myCookie);

[Read more →]

Tags: Programming

Learning ASP.Net AJAX (1)

November 16th, 2006 · No Comments

I am doing ASP.Net programming (using C#) these few days and I am thinking of a way to display interactive contents without post back the page. For example, there are two DropDownList, cboCategory and cboProduct respectively. If user clicked on cboCategory, all related products under the selected category will be displayed in cboProduct. In normal [...]

[Read more →]

Tags: Programming

© 2006–2010 Now Eating — Sitemap

Switch to our mobile site