Archive for November, 2007|Monthly archive page

แสดงหน้า crystal reports

‘หน้า ‘ + totext(PageNumber, ‘0′) + ‘ / ‘ + totext(TotalPageCount, ‘0′)

Form field hints with CSS and JavaScript

แสดง field hints สวยดี 

ref http://www.askthecssguy.com/2007/03/form_field_hints_with_css_and.html

ไฟล์ที่ได้จากการใช้ AJAX EXT

ScriptResource.axd?d=MwczlVkTtiei6BWJES_e2JIf0fSnL1TmmnpWhDlZO66LDkzzZuVZLXHNGOmYJ7bFxzI2TiyqhLRApjNlUQiiINQa3PUl8Rki1JoC7Qk4vKQ1&t=633239979820658649
ScriptResource.axd?d=MwczlVkTtiei6BWJES_e2JIf0fSnL1TmmnpWhDlZO66LDkzzZuVZLXHNGOmYJ7bFxzI2TiyqhLRApjNlUQiiIN75kLlzeMigCtecRqWaJ5GcovmBLtpdUY-6sniNq4rN0&t=633239979820658649
WebResource.axd?d=yMNywWGkVVh95kY4BOdB_g2&t=633239889146093750

ไฟล์ที่ได้มาจากการใช้  ajax exetensions
1.script manager ได้   WebResource.axd?…ขนาด  20,931
2.update panel ได้   ScriptResource.axd? 2 ไฟล์  84,019 และ 29,523 ตามลำดับ

Downloads Free

เรียกเมธอดใน Code Behind จาก Javascript

Registering scripts in ASP.NET controls (the right way)

 

public class BaseControl : Control {
        protected override void OnPreRender(EventArgs e) {
            Page.ClientScript.RegisterClientScriptInclude(
                GetType(),
                “InitScript”,
                ResolveClientUrl(“~/ScriptLibrary/BaseControlInitScript.js”));
            base.OnPreRender(e);
        }
    }

ref http://weblogs.asp.net/leftslipper/default.aspx

ASP.NET 2.0 Data Binding Tips – How to avoid Eval()

Sure, the syntax got easier. Instead of the cumbersome:

<%# DataBinder.Eval(Container.DataItem, “url”) %>

We get to save some strokes and remove the entire confusion around “what the heck is Container.DataItem?“:

<%# Eval(“url”) %>

But, this isn’t all its cracked up to be. Eval() STILL uses reflection to evaluate expressions, therefore for every bound column/row displayed in your ASP.NET pages, you are adding overhead, unnecessarily. Of course, what this really means is, just like with 1.1, you should be using explicit casts to cast Container.DataItem to its actual type:

<%# ((System.Data.DataRowView)Container.DataItem)["url"]) %>

Of course the trick is to know…you guessed it…what the heck is Container.DataItem??? A quick way to find this out for various objects you may choose to employ in binding, is to bind just to Container.DataItem as a test. In the attached example I bound the GridView control to the Web configuration sections:

Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);

ConfigurationSectionCollection webConfigSections = webConfig.Sections;

GridView1.DataSource = webConfigSections;

In the GridView declaration I included these labels in a template column:

<asp:Label ID=”Label2″ runat=”server” Text=’<%# Container.DataItem%>’></asp:Label>:

<asp:Label ID=”Label3″ runat=”server” Text=’<%# ((ConfigurationSection)Container.DataItem).SectionInformation.SectionName %>’></asp:Label>

Now you can consider yourself early bound.

ConfigurationUtility.zip (60.58 KB)
Source: dasBlonde (Michele Leroux Bustamante)

ref http://weblogs.asp.net/jgalloway/archive/2005/09/20/425687.aspx

How to install an assembly in the Global Assembly Cache

webapplication เป็น 2 tier หรือ 3 tier

ปัดเศษทศนิยมจาวาสคริปต์

Math.round(1982.465*Math.pow(10,2))/Math.pow(10,2)

Next Page »