vs 开发 asp.net过程中 引用 js文件出错的解决办法
在.net中通过这种方式引用js文件
<script type="text/javascript" src="setday0.js"></script>
然后在页面中调用setday0.js文件中的方法往往会出错!但是你如果把setday0.js文件的内容直接放到该页面中来又一点问题也没有。这个问题困惑了我很久,在1.1的时候就遇到了当时没办法就在页面中重写js代码。今天才发现了这个问题的解决办法。
这个问题是由于.net中的text编码所引起的,我们需要把setday0.js文件保存为UTF-8或者其他Unicode编码方式,问题就迎刃而解。原来的文本编码为gb2312,因为其中有汉字。
如何进行编码转换?
1、用记事本打开,保存的时候选择Unicode编码;
2、直接在vs中选择另存为,保存按钮右边有个小箭头,点一下,然后选择编码方式再保存就ok。
相关文档:
static void Main(string[] args)
{
string connstr = "Data Source=***;user=system;password=***;";
OracleConnection conn = new OracleConnection(connstr);
conn.Open();
string orclstr="insert into SYS.A_MODULE values('03','查看生产任务','查看生产任务进度')";
  ......
ASP.NET的内置对象介绍
1.Response
2.Request
3.Server
4.Application
5.Session
6.Cookie
Request对象主要是让服务器取得客户端浏览器的一些数据,包括从HTML表单用Post或者GET方法传递的参数、Cookie和用户认证。因为Request对象是Page对象的成员之一,所以在程序中不需要做任何的声明即可直接使用;其类名为 HttpR ......
//替换所有
Regex reg = new Regex(@"(?is)</?a\b[^>]*>(?:(?!</?a).)*</a>");
string result = reg.Replace(yourStr, "");
//保留www.abc.com链接
Regex reg = new Regex(@"(?is)</?a\b.*?href=(['""]?)(?!(?:http://)?www\.abc\.com)[^'""\s>]+\1[^>]*>(?<text>(?:(?!</?a).) ......
The MVC bits have finally arrived and I’ve spent a while digesting them. I’ve been waiting for the bits to be released to begin working on a side-project, so the first thing I did after downloading them last night was crank it up and start working on a new ASP.NET MVC Web Application p ......
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open
('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attributes.Add("o ......