asp.net中引入外部js文件的中文乱码问题
asp.netasp.net中引入外部js文件,容易产生中文乱码,讨论解决方法。[@more@]在asp.net中时常需要调用js代码,如果js写在asp.net中,一般是不会出现乱码的问题。因为他们具有相同的编码。如果需要引用外部的javascript代码就会有乱码的风险了。一般情况下Asp.net和Javascript的页面编码不是GB2312就是Utf-8 ,如果两者的编码不一致就会产生乱码。解决方法就是想两者的编码进行统一。由于一般情况下Asp.net接受发送请求的编码是Utf-8的,javascript编码默认是Gb2312,故容易出现问题。在Asp.net中可以在两个地方设置接受发送编码 1.Web.c
Globalization issues in ASP and ASP.NET
IntroductionWelcome! This is Sukesh Khare with the Microsoft ASP.NET Developer Support team. This is the first time I've authored a Support Voice column. I look forward to authoring more such columns in the months ahead.For this month's column, I am going to discuss globalization issues in Active Server Pages (ASP) and ASP.NET, the issues that we face in ASP, how things have changed in ASP.NET 1x, and what's up with ASP.NET 2.0 on the globalization front.Note If you come across a term you don't
Asp.net中与codePage="936"有关的css失效等奇怪问题的解决办法
Asp.net中与codePage="936"有关的css失效等奇怪问题的解决办法时间:2007-05-03 阅读:80 类型:转载 编辑:陈姐 关键字:Asp.net codePage= 936 css [@more@]最近手头有个简单的项目,比平时写的要简单很多,但是却很不顺利,出现了好多奇怪的问题, 比如今天就遇到一个奇怪的问题,这里我讲一下解决全过程. 客户要求,在DropDownList中选择第二项时,有一个TextBox要不可用,本来这种问题是很简单的,将DropDownList的AutoPostBack属性设置为"True",然后在DropDownList的SelectedIndexChanged事件里写一下代码: if(ddlFrame.S
fckeditor.asp导致Js的alert的中文乱码问题
fckeditor.asp导致Js的alert的中文乱码问题作者:西城百慕 日期:2007-07-15[@more@]刚才在做文章发布的时候遇到一个很奇怪的错误,之前自己定义了一个程序输出javascript的alert弹出提示的函数过程,在程序处理页面调用的时候只要传递的参数中含有中文的话输出的都是乱码,以为是文件编码问题导致的乱码毕竟这个很常见,检查之后发现并不是这个问题编码一切正常. 程序代码Function alert(message,gourl) message = replace(message,"'","'")If gourl="" or gourl="-1" thenResponse.Write ("<
A More Efficient Method for Paging Through Large Result Sets
IntroductionIt is amazing the amount of cycles, hardware and brain ware, go into paging results efficiently. Recently Scott Mitchell authored an article titled Efficiently Paging Through Large Result Sets in SQL Server 2000 that looked at a stored procedure that returned a particular "page" of data from a table. After examining Scott's approach, I saw some potential improvements in his method. (If you haven't yet perused Scott's technique, take a moment to do so before continuing here,
ObjectDataSource.DeleteMethod 属性
注意:此属性在 .NET Framework 2.0 版中是新增的。 获取或设置由 ObjectDataSource 控件调用以删除数据的方法或函数的名称。 命名空间:System.Web.UI.WebControls程序集:System.Web(在 system.web.dll 中)[@more@]语法Visual Basic(声明)Public Property DeleteMethod As String Visual Basic(用法)Dim instance As ObjectDataSource Dim value As String value = instance.DeleteMethod instance.DeleteMethod = value C#public string DeleteMethod { get; set; } C++public: property String^ DeleteMethod { S
Declaring Data SourcesThe <asp:AccessDataSource> Control
Although much of the content of Web pages comes from fixed text and HTML and from output produced from user inputs, the majority of information comprising modern Web sites is extracted from external data sources residing on the server -- from databases, text files, XML files, and other such data stores. Web page controls and scripts retrieve this external information, process it, and display it through other server controls to create final Web page output. The page is created dynamically, when i
DropDownList in a FormView Control
Another in an apparently relentless series of posts about trying to see how much can be done with the new data controls in ASP.NET 2.0 without writing code. It's pretty easy to take advantage of the code hooks we all know and love, like the ItemDataBound event in the DataGrid control (RowDataBound in the GridView control). which lets you do a whole lotta stuff. A more interesting challenge is to see what you can do with no code at all.(referred rom mike's weblog)[@more@]A question came up severa
ASP.NET 2.0 本地化技术之研究(2)
1.这只是单个页面的切换,如何做整个站点的切换呢?( hjh )2.关于如何将资源直接显示……既然控件能够将嵌入dll的资源直接显示,不知道网站能否也将嵌入资源直接调用WebResource显示呢?(Cat Chen )由于不是一两句可以说清,所以再开一篇仔细讲一下。内容列表:1.整站本地化资源的切换2.使用ProFile保存用户选择的语言3.关于WebResource的使用4.代码下载[@more@]1.整站本地化资源的切换在上一篇里我们讲到,可以通过重载页面的InitializeCulture函数,在其中切换当前线程的CurrentUICulture和CurrentCulture来实现本页的资源切换。那么
The difference between literal and label.
this article introduces the difference between literal control and label control in asp.net 2.0[@more@]Label The Label Web Server control is used to label other parts of the application. They are used to display text which the user can't change. To display text on a label we use the text property. The class hierarchy for this control is as follows: Object Control WebControl Label A label control with BorderStyle property as solid and BorderColor property as blue is shown below. I
Asp.net数据绑定表达式语法
使用数据绑定语法,可以将控件属性值绑定到数据,并指定值以对数据进行检索、更新、删除和插入操作。[@more@]数据绑定语法数据绑定表达式包含在 <%# 和 %> 分隔符之内,并使用 Eval 和 Bind 函数。Eval 函数用于定义单向(只读)绑定。Bind 函数用于定义双向(可更新)绑定。除了通过在数据绑定表达式中调用 Eval 和 Bind 方法执行数据绑定外,还可以调用 <%# 和 %> 分隔符之内的任何公共范围代码,以在页面处理过程中执行该代码并返回一个值。 调用控件或 Page [ http://msdn2.microsoft.com/zh-cn/library/system.web.ui.pa
Enterprise Library 3.0 (3) Validation Application Block与ASP.NET集成
摘要:也许大家都已经习惯了使用ASP.NET中的验证控件进行数据有效性的验证,但是验证控件的验证无法与我们的自定义的实体类结合起来,两者属于不同层面的验证。在Enterprise Library 3.0中有了Validation Application Block,可以轻松的实现页面验证与类验证的结合。[@more@]1.编写实体类,本文我使用Enterprise Library 3.0 QuickStarts中的例子,采用Atteribute验证的方式(采用配置文件来实现也是一样的),分别设置验证规则集合、错误信息提示等属性,代码如下:.添加PropertyProxyValidator控件。在工具箱中添加新项,选择Microsof
Enterprise Library 3.0 (2) 配置文件设置Validation Application Block
摘要:Enterprise Library 3.0 January 2007 CTP版发布了,这次发布的版对于Validation Application Block有了很大的改进,包括对配置工具的支持,与ASP.NET以及WinForm的集成等新的特性。在上一篇文章中我介绍了如何使用Attribute来实现验证,文本看一下如何利用配置文件来使用Validation Application Block。[@more@]1.新建一个控制台应用程序,仍然使用我在前一篇文章中用过的User实体类,这跟我们编写的普通业务对象并没有任何区别:public class User{ private String _name; private int _age; public String Name {
Enterprise Library 3.0 (2) Validation Application Block
摘要:在Enterprise Library 3.0 December 2006 CTP版中,加入了一个新的成员Validation Application Block,用来实现对业务对象的验证。它支持两种方式的验证,通过特性Attribute和通过配置文件,但是在最新版本中并没有提供配置的设计时支持,我们只能通过手动去修改配置文件来实现,所以本文主要看一下通过Attribute来实现验证。[@more@]主要内容1.通过ValidationFactory创建验证器2.通过外观类实现验证一.概述在Enterprise Library 3.0 December 2006 CTP版中,加入了一个新的成员Validation Application Block,用来实现对业务对象
Enterprise Library 3.0 (1)
摘要:在圣诞节来临之前,微软模式与实践小组发布了Enterprise Library 3.0 2006 December CTP版本,本文简单的介绍一下Enterprise Library 3.0集成到VS2005的配置工具和对配置区的加密支持以及对标准AppSetting配置区的支持。[@more@]主要内容1.集成到VS2005中的配置工具2.配置区加密支持3.对标准AppSetting配置区的支持 一.集成到VS2005中的配置工具在Enterprise Library 3.0之前的两个版本,配置工具都是作为一个单独的应用程序,我也曾经介绍过一款把Enterprise Library配置工具集成到VS中的插件(Enterprise Library 2.0 插件介绍
Uploading Files Using the File Field Control
Learn how to use the Microsoft ASP.NET File Field control to allow your end-users to upload one or more files to your server. (16 printed pages)[@more@]IntroductionMicrosoft® ASP.NET Web Forms are all about communicating with an end-user to abstract what information you need to from them depending on the service administered. In many cases with Web Forms, it is usually simply textual data that is collected and stored. However, there are many cases where you are going to need more than simple