在asp.net 2.0 中提供多语言转换和多样式主题转换功能,两种实现形式比较类似,所以放在一起说明一下。1. language switcher 多语言转换在quick start tutorial 中,介绍了如何存储和应用用户选择的语言。一般是用一个dropdownlist展示支持的语言,供用户选择,通常是放在masterpage 里面,将用户选择的语言存储起来 这里用了asp.net 2.0的profile,当然也可以存在cookie session 或者querystring里。在页面里重写initializeculture 方法,使用用户之前选择的语言。因为设置语言的操作 (这里是selectedindexchanged事件)发生在initializeculture 时间后面,所以在设置操作完成后为了使的当前页面也马上生效,需要做个重转向,以从新加载本页面,触发initiali...
asp.net 2.0 treeview has many built-in features such as showing a checkbox for all the tree nodes. node level formating, style, etc., enabling the showcheckboxes="all" property sets it to show a checkbox for all the nodes. the other options are leaf, none, parent and root which show checkboxes at the respective node levels. none doesnt display checkboxes.when we set showcheckboxes="all", we would ...
在网站的制作中经常需要开发下载文件的功能,下面三种下载文件的办法:1、asp实现下载的代码<% filename = request.querystring("filename")if filename = "" then response.write "请输入filename参数,指定下载的文件名"else response.contenttype = "application/octet-stream" response.addheader "content-disposition", "attachment; filename =" & filename set filestream = server.createobject("adodb.stream") filestream.mode = 3 filestream.type = 1 filestream.open ...
<%@ import namespace="system.data" %> <%@ import namespace="system.data.oledb" %> <script laguage="vb" runat="server"> dim myconnection as oledbconnection dim mycommand as oledbcommand sub page_load(sender as object,e as eventargs) '1.连接数据库 dim dbname as string dbname=server.mappath("authors.mdb") myconnection = new oledbconnection( "provider=microsoft.jet.oledb.4.0;data source...
english version: http://dflying.dflying.net/1/archive/120_build_your_own_behaviors_in_aspnet_atlas.html atlas中的behavior定义了当控件的某个事件被触发时的行为。behavior可以看作是一种封装了的dhtml的事件,例如click和hover等。behavior同样可以是一个组件,可被attach到某个atlas客户端控件上,以提供这个atlas客户端控件更高级,更丰富的功能,例如一些复杂的拖放(drag & drop),自动完成,浮动等功能。behavior将被定义在某个atlas控件的behaviors集合中。从atlas文档以及源文件中,我们可以知道atlas有如下一些内建的behavior:click behavior:提供对鼠标点击的处理。 floating...
实现效果:在主表里选中某行,从表里得出该行的详情。方法1:代码实现。在页面上放一个gridview,一个detailview。数据绑定gridview并且要设置主键,然后在selectedindexchanged事件写代码:选择发生变化时,detailview也改变为相应的detail。具体代码:using system;using system.data;using system.configuration;using system.collections;using system.web;using system.web.security;using system.web.ui;using system.web.ui.webcontrols;using system.web.ui.webcontrols.webparts;using system.web.ui.htmlcontrols...
可能有些朋友还不是很清楚themes、skins。下面先介绍下themes、skins.。一、简介:一看themes、skins这2名字就都知道是用来做什么的了吧,下面就说下它是做什么的(怎么都知道了还说,~_~),利用themes我们可以很容易的更改控件、页面的风格,而不需要修改我们的代码和页面文件。themes文件被单独的放在1个app_themes文件夹下面,与你的程序是完全分开的。二、怎么使用themes和skins:先看个非常简单的实例:app_themesdefault1.skin文件代码: <asp:label font-bold="true" forecolor="red" runat="server" />default.aspx:文件代码:<%@ page language="c#" theme="default" %><!doctyp...
本文总结如何在.net winform和.net webform(asp.net)中将图片存入sql server中并读取显示的方法 。1.使用asp.net将图片上传并存入sql server中,然后从sql server中读取并显示出来:1)上传并存入sql server 数据库结构 create table test { id identity(1,1), fimage image } 相关的存储过程 create proc updateimage ( @updateimage image ) as insert into test(fimage) values(@updateimage) go 在upphoto.aspx文件中添加如下: <input id="upphoto" name="upphoto" runat="server" type="file"> <...
log4net是apache log4j的.net版,是一套xml配置型的日志引擎,正好最近有个程序需要日志系统,为了整合方便,就决定研究一下。感谢郝伟推荐。log4net系统划分了7个日志等级,如设置为"warn",则debug,info不会被记录。如下:1. all2. debug3. info4. warn5. error6. fatal7. offcreating the sample applicationstep 1: 下载log4net去logging.apache.org/log4net,来获取他们的最近版,在例子里我用的是incubating-log4net-1.2.9-beta.zip,期待正式版。step 2: 创建 asp.net web 应用程序 创建这个就不多说了,在log4net-1.2.0-beta8binnet如图。找到对应的dll,添加到引用里。有的...
组件的一些公共属性不希望被vs在设计时加到initializecomponent()方法中怎么处理呢?我试过了,将属性加上[browsable(false)]也不行。我的代码如下: /// <summary> /// 控制器通讯类型下拉列表框。 /// </summary> public class communicationtypecombobox : combobox { /// <summary> /// 构造列表框实例。 /// </summary> public communicationtypecombobox() { items.add("串口"); items.add("tcp"); } /// <summary> /// 获取列表框中的所有项。 /// </summary> [browsable(fa...
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器