Tag: asp.net
Default Button and Default Focus in Master Page.
by calendarw on Jan.17, 2008, under coding snippet
自從轉左用 ASP.net 2.0 既 Master Page 之後, 個 form 出左出面, 所以以為無得用 Form Set Default Focus 同 Default Button, 阿敏今日 send 左個 site 比我, 入面考用 Page.Form 黎 Set Default Focus 同 Default Button, 要注意既係用 Default Button 既 UniqueID 同埋 Default Focus 既 ClientID
Page.Form.DefaultFocus = TextBox1.ClientID Page.Form.DefaultButton = Button1.UniqueID
Adding ListItems don’t work with CheckboxList,RadiobuttonList etc.
by calendarw on Oct.09, 2007, under error handling
This is a bug of asp.net in 1.0 and 1.1, you may need to use HtmlInputRadioButton instead of RadioButtonList or HtmlSelect instead of DropDownList
Microsoft Article: 309338
ASP.NET Event Validation
by calendarw on Aug.20, 2007, under error handling
[http://asp.net ASP.net] 2.0 添加了 event validation 的功能, 用來檢查張 form 的 variable, 如果張 form 係一開始時無將 possible variable encode 入個 session 度, 就會 throw exception:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=”true”/> in configuration or <%@ Page EnableEventValidation=”true” %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
