ASP.NET常用代码

豆豆网   技术应用频道   2007年09月02日  【字号: 收藏本文

内容摘要:ASP.NET常用代码

  【大小写转换】

  HttpUtility.HtmlEncode(string);

  HttpUtility.HtmlDecode(string)

  19.如何设定全局变量

  Global.asax中

  Application_Start()事件中

  添加Application[属性名] = xxx;

  就是你的全局变量

  20.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口?

  HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank")

  【ASPNETMENU】点击菜单项弹出新窗口

  在你的menuData.xml文件的菜单项中加入URLTarget="_blank"

  如:

<?xml version="1.0" encoding="GB2312"?>
<MenuData ImagesBaseURL="images/">
<MenuGroup>
<MenuItem Label="内参信息" URL="Infomation.aspx" >
<MenuGroup ID="BBC">
<MenuItem Label="公告信息" URL="Infomation.aspx" URLTarget="_blank" LeftIcon="file.gif"/>
<MenuItem Label="编制信息简报" URL="NewInfo.aspx" LeftIcon="file.gif" />
......

  最好将你的aspnetmenu升级到1.2版

  21.委托讨论

  http://community.csdn.net/Expert/topic/2651/2651579.xml?temp=.7183191

  http://dev.csdn.net/develop/article/22/22951.shtm

  22.读取DataGrid控件TextBox值

foreach(DataGrid dgi in yourDataGrid.Items)
{
TextBox tb = (TextBox)dgi.FindControl("yourTextBoxId");
tb.Text....
}

作者:周建东    责编:豆豆技术应用

正在加载评论...