asp.net c# js服务器端常用
using System;
using System.Web;
namespace pub.mo
{
public class js
{
private js() { }
private static string scr_j1 = "<mce:script type=\"text/javascript\"><!--
";
private static string scr_j2 = "
// --></mce:script>";
/// <summary>
/// 输入js并停止运行
/// </summary>
/// <param name="str"></param>
public static void write_js(string str)
{
HttpContext.Current.Response.Write(config.j1);
HttpContext.Current.Response.Write(scr_j1);
HttpContext.Current.Response.Write(str);
HttpContext.Current.Response.Write(scr_j2);
HttpContext.Current.Response.Write(config.j2);
HttpContext.Current.Response.End();
}
/// <summary>
/// 输入js,无Response.End()
/// </summary>
/// <param name="str"></param>
public static void write_js1(string str)
{
HttpContext.Current.Response.Write(config.j1);
HttpContext.Current.Response.Write(scr_j1);
HttpContext.Current.Response.Write(str);
HttpContext.Current.Response.Write(scr_j2);
HttpContext.Current.Response.Write(config.j2);
}
/// <summary>
/// 弹出消息框 点确定后history.back();
/// </summary>
/// <param name="str"></param>
public static void alert(string str)
{
HttpContext.Current.Response.Write(config.j1);
HttpContext.Current.Response.Write(scr_j1);
HttpContext.Current.Response.Write("alert('" + str + "');history.back();");
HttpContext.Current.Response.Write(scr_j2);
HttpContext.Current.Response.Write(config.j2);
HttpContext.Current.Response.End();
}
/// <summary>
///
/// </sum
相关文档:
C#连接Oracle数据库字符串
http://developer.51cto.com
2009-08-20 17:55 佚名 百度空间 我要评论(
0
)
C#连接Oracle数据库以及C#连接Oracle数据库字符串等内容将在本文中展现,希望本文能对大家了解C#连接数据库有所帮助。
C#连接Oracle数据库字符串(查询数据)
using
Syst ......
关于页面传值的方法,引发了很多讨论。1. 使用QueryString变量。2. 使用Application 对象变量。4. 使用Cookie对象变量。这个才可以说是面象对象开发所使用的方法,其使用Server.Transfer方法把流程从当前页面引导。
1. 使用QueryString变量
QueryString是一种非常简单的传值方式,他可以将传送的值显示在浏 ......
如果你已经有较多的面向对象开发经验,跳过以下这两步:
第一步 掌握一门.NET面向对象语言,C#或VB.NET。
我强烈反对在没系统学过一门面向对象语言的前提下去学ASP.NET。
ASP.NET是一个全面向对象的技术,不懂面向对象,那绝对学不下去!
第二步 对.NET Framework类库有一定的了解
可以通过开发Windows Form应用 ......
利用 Page.RegisterStartupScript("", "<script language='javascript'> results();</script>");
或者是 Page.RegisterClient ......