29
2012
04

jQuery实现视频上传功能

    <script language="javascript" type="text/javascript">
        function check() {
            var d = document.forms[0];
...

28
2012
04

jQuery实现声音上传功能

    <script type="text/javascript">
        KE.show({
            id: 'pb-text-textarea',
            imageUploadJson: '/kindeditor/plugins/upload_json.ashx',
...

27
2012
04

jQuery实现图片上传功能

    <script type="text/javascript">

        var jq = jQuery.noConflict();
        jq(document).ready(function () {
            var user = "";
...

26
2012
04

Asp.Net 如何DropdownList读取值,并使用JS通过ID赋值

        public void GetCustomerGroup()        {            try  &

25
2012
04

查询数据库并绑定到GridView

protected void Button1_Click(object sender, EventArgs e)
{
SqlDataSource sqlSource = new SqlDataSource(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString,
"SELECT * FROM [tb_ title] WHERE Title like '%@TitName%' and Info like '%@TeaName%';");
24
2012
04

左侧菜单效果的展开收缩效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...

22
2012
04

jQuery、ashx 登录功能的实现

<script type="text/javascript" language="javascript">

    var jq = jQuery.noConflict();

    jq(document).ready(function () {
    jq("#text_mail").focus(function () {  //邮件框的颜色变化,点击离开的变化
...

20
2012
04

Asp.Net 弹出对话框,提示用户

if (read.HasRows)

            {

           Response.Write("<script language=javascript>alert( '该用户已注册!');window.location.href='StuInsert.aspx';</script>");

或者

           System.Web.UI.Page.ClientScript.RegisterStartupScript(System.Web.UI.Page.GetType(), "message", "<script language='javascript' defer>alert('该用户已注册!');location.href='StuInsert.aspx'</script>");

...
20
2012
04

js 去掉空格键 和 js过滤特殊字符

过滤空格键

<script>
function trim(inputString) {
               //xiao duan 22/06/2007
              if (typeof inputString != "string") { return inputString; }
...

19
2012
04

C# 进行数据库连接并将获得的表绑定到DataGridView中

//获取数据表信息并绑定到DataGridView中
TableClassBLL tableBLL = new TableClassBLL();
DataTable data = tableBLL.TableDBTable(where); //执行获取数据库中的表字段
DgvTable.DataSource = data;
DgvTable.AutoGenerateColumns = false; //手动生成列

public DataTable TableDBTable(string where)
...
19
2012
04

C# 进行登录数据库连接并保持连接信息

private void BtnConn_Click(object sender, EventArgs e)
{
if (CheckDBCon())
{
ConnHelper.IP = TxtIP.Text.Trim();
ConnHelper.DBName = TxtDBName.Text.Trim();
ConnHelper.UserID = TxtUserID.Text.Trim();
...
18
2012
04

Asp.Net GridView批量删除数据操作

          IList<ZhenInfo> LzhenInfo = (IList<ZhenInfo>)Session["zhenInfo"];  //使用IList来存储要删除的实体列表
            //循环gridview中的数据到实例类中
            for (int i = 0; i < GridView1.Rows.Count; i++)
...

17
2012
04

jQuery 邮件格式判断

function check_email() {

    if (jq("#text_mail").val() == "") {

        jq("#mail_error").show();  //提示格式错误

        return false;

    }

    else {

...
17
2012
04

JS 实现简单打印功能

    <table style="font-size: 12px">
        <tr>
            <td style="width: 78px; height: 30px; text-align: left;">
                <input type="button" name="print" value="打印资料" onclick="preview()" />  //打印按钮,使用js的preview()进行打印
            </td>
            <!--startprint-->  //要打印的内容开始地方

16
2012
04

Asp.Net 获取某个文件夹中的文件名,并存入到DropDownList中

//参数为指定的目录
public void FindFile(DropDownList dropList)
{
string Path = Server.MapPath("~//DbFile"); //指定在服务器上的路径
//在指定目录及子目录下查找文件,在DropDownList 中列出子目录及文件
DirectoryInfo Dir = new DirectoryInfo(Path);
...
16
2012
04

Asp.Net 数据库恢复

//点击恢复按钮,执行ReBakData恢复方法,传入数据库名和要恢复数据库的路径
protected void btnOK_Click(object sender, EventArgs e)
{
try
{
if (DropDownList1.Text.Trim() != "")
{
//string dbFileName = txtDbFileName.Text.Trim();
...
16
2012
04

Asp.Net 数据库备份

//读取sql数据库里面的所有数据库,并将这些数据库绑定到DropDownList里面,主要是绑定数据库名
public SqlDataReader GetServerList(DropDownList ddlDatabaseList)
{
ArrayList arr = new ArrayList();
SqlConnection connection = null;
SqlCommand command = null;
...
12
2012
04

C# 读取信息并发送邮件

//读取信息并发送邮件
private void btnSendMail_Click(object sender, EventArgs e)
{
header = "" + txtTitle.Text + "";
...
12
2012
04

C# 打开Excel文件,并将标题加载到ComboBox中

private void btnOpenFile_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDailog1 = new OpenFileDialog();
openFileDailog1.Filter = "Excel 文件(*.xls)|*.xls|所有文件(*.*)|*.*";
if (openFileDailog1.ShowDialog() == DialogResult.OK)
...
12
2012
04

C# 邮件格式判断

public bool CheckEmail(string strEmail)
{
int i, j;
string strTmp, strResult;
string strWords = "abcdefghijklmnopqrstuvwxyz_-.0123456789"; //定义合法字符范围

bool blResult = false;
strTmp = strEmail.Trim();
...