• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

asp.netnotes

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
  1. Password TextBox and PostBack
    // Refill Password field
    this.txtPassword.Attributes.Add("value", this.txtPassword.Text);
  2. ajax cascadingdown, 只能在放有cascadingdown控件的页面上设置static web method.
    或统一指定一个ajax web service取得数据. 如果有多个下拉框的数据需要取得,.
    可以使用一个web user control设置dropdownlist/cascadingdown,然后将相应的参数设置为此control的属性,并指定一个固定的web service来返回数据,从而所有相似数据只需要一段DA代码就可以返回这些cascadingdown dropdownlist. 但在取数据的web service method代码中需要能根据不同的页面参数获取不同的数据. 可以WS方法中使用category参数来区别.

  3. 如果ajax-enabled的页面报如下错误:
    ajax: sys.invalidoperationexception: handler was not added through the sys.ui.domevent.addhandler
    则在页面的 scriptmanager属性中设置scriptmode=release.

  4. reuse web user control or pages

control lib project is a web application project, and after compiling it, there will be just one dll, but the dll can't include aspx define, just code. so u should add a web deploy project.
if the project is web site project, building this project will not generate any dll. u should add a web deploy project to refer it. and build the deploy project to generate one deploy dll

in web deploy project, if "allow this precompiled site to be updateable" option is checked, then pages/controls UI code will be remained, and all code-behind files will be removed.
if not check this option, then all pages just keep one line to prompt there is no UI content, and user control files will be deleted.
so if u want to reuse page, u must check this option, otherwise the remained page can't be reused.
and the user control can be reused in two methods
1. build web user control web project into a single assembly without this option
  then there is no web user control files(ascx) remain after build
  u can use this dll into another web project by two methods
    one is declare the dll's tagprefix, namespace and assembly in web.config, then use its controls like asp.net controls.
    two is add the register in each used pages, and declare the user control.
2. if build with this option,
then u can copy the output directory all to another project, and reuse the page or user controls.

  1. ref:
    http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx
    http://webproject.scottgu.com/CSharp/UserControls/Usercontrols.aspx
    http://www.codeproject.com/useritems/User_Control_ToCustom_One.asp

    PHP migrate to asp.net
    http://www.asp.net/downloads/archived/migration-assistants/php-to-aspnet/



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
十天学会ASP.net之第十天发布时间:2022-07-10
下一篇:
asp.net中日期选择器发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap