ASP.NET JS常用方法类
using System.Web;
/// <summary>
/// Javascript常用方法
/// </summary>
public class JS
{
private static string ScriptStart = "<script type=\"text/javascript\">";
private static string ScriptEnd = "</script>";
/// <summary>
/// 写入JS脚本内容
/// </summary>
/// <param name="ScriptString">脚本内容</param>
/// <param name="IsResponseEnd">是否中断服务端脚本执行</param>
public static void WriteScript(string ScriptString, bool IsResponseEnd)
{
HttpContext.Current.Response.Write(ScriptStart);
HttpContext.Current.Response.Write(ScriptString);
HttpContext.Current.Response.Write(ScriptEnd);
if (IsResponseEnd)
{
HttpContext.Current.Response.End();
}
}
/// <summary>
/// 弹出警告框
/// </summary>
/// <param name="AlertMessage">提示信息</param>
/// <param name="IsResponseEnd">是否中断服务端脚本执行</param>
public static void Alert(string AlertMessage, bool IsResponseEnd)
{
HttpContext.Current.Response.Write(ScriptStart);
HttpContext.Current.Response.Write("alert('" + AlertMessage + "');history.back();");
HttpContext.Current.Response.Write(ScriptEnd);
&nb
相关文档:
Asp.Net Forms验证(自定义、角色提供程序、单点登录)
以前开发项目时经常是自己开发一套用户权限管理系统进行验证,比较灵活。最近为了单点登录的问题又把Asp.Net自带的验证方式看了一遍,发现这种方式也比较方便,功能也还可以。在Asp.Net提供了三种常用的验证方式:Windows方式是和IIS结合起来可以实现基本、摘要、集成 ......
在最近开始将AJAX技术加入到日常的开发工作中。我在最近写了个AJAX的无刷新登陆且动态添加服务器控件的工作,我将此功能告诉大家希望对大家的工作有所帮助。如果大家有更好的方法且愿意在此留言让我也可以分享到你的成果。
首先在页面中的HTML标记中加入控件UpdatePanel和两个Textbox一个Button:
<asp:UpdatePanel ID ......
一,如果直接把asp.net mvc2 RC 部署在iis5.1上,会出现无法显示页面的情况,原因可能是路径映射没有起作用。
解决办法:
1.在 routes.MapRoute(
"Default", ......
一、ASP.NET Web Service代码
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.SqlClient;
namespace WebService1
{
/// <sum ......
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.ComponentModel;
namespace SQLHelper
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class SQLHelper
{
// 连接数据源
......