04 2009 档案
摘要:CheckBoxField竟然不支持int型的数据现扩展加上int的支持,如果为0,则不选中,为1,则选中.代码: public class CheckBoxFieldPro : CheckBoxField { protected override void OnDataBindField(object sender, EventArgs e) { System.Web.UI.Control co...
阅读全文
摘要:使用DropDownList,我们习惯在所有待选数据前面加一个空白项,或者"请选择"的提示,微软却没有,这可能就是中西文化的差异.现在扩展为DropDownListPro经过代码调试,和看源代码,得知默认选中的行为是在SelectedIndex的Get方法中设置的.所以重载该方法,即可达到目的.public class DropDownListPro: DropDownList { public ...
阅读全文
摘要:function getParameter(name,cancelBubble){var r = new RegExp("(\\?|#|&)"+name+"=([^&#]*)(&|#|$)");var m = location.href.match(r);if ((!m || m=="") && !cancelBubble) m = top.location...
阅读全文
摘要:1.要在Oninit中加载控件,因为在Oninit后,紧接着,在Load前,页面执行ViewState回填,会也用户输入的值回填到控件,也捎带上这个控件.protected override void OnInit(EventArgs e) { WebUserControl1 ucSampleRequestGridItem = (WebUserControl1)LoadControl("WebUs...
阅读全文

浙公网安备 33010602011771号