易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : asp.net

在 vs2008为asp.net ajax添加js智能感知


vs2008为asp.net ajax添加js智能感知



今天找了好久,终于搞清楚了,scriptManager控件支持js智能感知,而从其继承的toolkitScriptManager不支持。至少在
vs2008b2中是这样。
要在js文件中添加asp.net ajax的js智能感知(与scriptManager控件无关),在js文件的开头添加这样一行即可:
//
/<reference name="MicrosoftAjax.js"/>
若要在aspx文件中添加智能感知,网上很多都说可以在ScriptManager标记内添加
<
Scripts
>
  
<
asp:ScriptReference 
Path
="
"
 
/>
</
Scripts
>
               
不过我基于toolkitScriptManager如此尝试仍然失败了,最后自己把C:\Program Files\Microsoft
ASP.NET\ASP.NET 2.0 AJAX
Extensions\v1.0.61025\MicrosoftAjaxLibrary\System.Web.Extensions
\1.0.61025.0目录下的MicrosoftAjax.js文件拷贝到project的js目录下,然后用传统的js方式引用
<
script src
=
"
js/MicrosoftAjax.js
"
 type
=
"
te ......

在 vs2008为asp.net ajax添加js智能感知


vs2008为asp.net ajax添加js智能感知



今天找了好久,终于搞清楚了,scriptManager控件支持js智能感知,而从其继承的toolkitScriptManager不支持。至少在
vs2008b2中是这样。
要在js文件中添加asp.net ajax的js智能感知(与scriptManager控件无关),在js文件的开头添加这样一行即可:
//
/<reference name="MicrosoftAjax.js"/>
若要在aspx文件中添加智能感知,网上很多都说可以在ScriptManager标记内添加
<
Scripts
>
  
<
asp:ScriptReference 
Path
="
"
 
/>
</
Scripts
>
               
不过我基于toolkitScriptManager如此尝试仍然失败了,最后自己把C:\Program Files\Microsoft
ASP.NET\ASP.NET 2.0 AJAX
Extensions\v1.0.61025\MicrosoftAjaxLibrary\System.Web.Extensions
\1.0.61025.0目录下的MicrosoftAjax.js文件拷贝到project的js目录下,然后用传统的js方式引用
<
script src
=
"
js/MicrosoftAjax.js
"
 type
=
"
te ......

Online active users counter in ASP.NET


Online active users counter in ASP.NET
With this tool which is written for ASP.NET, it is possible to count the number of online users, members and guest users in web sites.
Installation
The tool installation is very simple and only takes a few minutes.
Step one - Add Reference:
After downloading the attachment, you should add a reference to the project. If you know how to add references please skip this step.
To add the reference, right click on your solution and select "Add Reference" from the menu. Then select the "OnlineActiveUsers.dll" file. Now the reference is added to the solution.
Step two - Change configuration:
Open the "Web.config" file from your project (If this file is absent, right click on your project and from "Add new item", select "Web configuration file"). Then add this code on "web.config" file.
<httpModules>
<add name="OnlineActiveUsers" type="OnlineActiveUsers.OnlineUsersModule"/>
</httpModules>
Note that this code should be pla ......

asp.net准确截取文本长度(取得标题的字符数)

asp.net中自带的CutString只能截取字符数量的长度,但中英文字符数有差异,一个中文字等同于二个英文字符的宽度,这样对截取后的效果不理想.使用以下的方法就能解决.
//调用方法
string title=BLL.CutStr.CutString("标题",10);using System;
using System.Collections.Generic;
using System.Text;
namespace BLL
{
    public  class CutStr
    {
        public static string  CutString(string str, int length)
        {
            if (str == "" )
            {
                str = "没有信息";
            }
            else
            {
  ......

ASP.NET中字符串进行MD5加密

最近在看《asp.net通用模块及典型系统开发实例导航》,其中用到了MD5加密,代码如下: /// <summary>
/// 字符串加密函数
/// </summary>
/// <param name="strInput">输入被加密的字符串</param>
/// <returns>加密后的字符串</returns>
public static string Encrypt(string strInput)
{
//转换为UTF8编码
byte[] b = System.Text.Encoding.UTF8.GetBytes(strInput);
//计算字符串UTF8编码后的MD5哈希值,并转换为字符串
MD5 md5 = new MD5CryptoServiceProvider();
return System.Text.Encoding.UTF8.GetString(md5.ComputeHash(b));
}

在IE下测试了,在数据库里看到的确实是加密之后的字符串。
现在考虑的问题是,该如何实现解密? ......

使用WebClient自动填写并提交ASP.NET页面表单


使用WebClient自动填写并提交ASP.NET页面表单
      在.NET中通过程序填写和提交表单还是比较简单。比如,要提交一个如下图所示的登录表单:
           
填写和提交以上表单的代码如下:
       // 要提交表单的URI字符串。
       string uriString = "http://www.xxx.com/Login.aspx";
       // 要提交的字符串数据。
       string postString = "userName=user1&password=password1";
       // 初始化WebClient
       WebClient webClient = new WebClient();
       webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
       // 将字符串转换成字节数 ......

使用WebClient自动填写并提交ASP.NET页面表单的源代码

 try
    {
        // 要提交表单的URI字符串。
        string uriString = "http://localhost:1165/WebTest/MyLogin.aspx";
        ///////////////////////////////////////
        // 打开页面
        ///////////////////////////////////////
        WebClient webClient = new WebClient();
        byte[] responseData = webClient.DownloadData(uriString);
        string srcString = Encoding.UTF8.GetString(responseData);
        ///////////////////////////////////////
        // 填写页面并提 ......
总记录数:2672; 总页数:446; 每页6 条; 首页 上一页 [128] [129] [130] [131] 132 [133] [134] [135] [136] [137]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号