Implementation of loading effect in Asp.net

Source: Internet
Author: User
 

This effect has long been achieved and has never been implemented. Today I took some time to do this. Finally, it is done.

Front-end code:

<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default2.aspx. cs" inherits = "default2" %> <! 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"> 

Background code:

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class Default2 : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {    }    protected void Button1_Click(object sender, EventArgs e)    {        SqlConnection conn = new SqlConnection();        conn.ConnectionString = "server=10.68.69.203,81;database=cpudata;user id=sa;password=19790601";        try        {            conn.Open();            SqlCommand cmd = new SqlCommand();            cmd.Connection = conn;            cmd.CommandText = "SELECT top 888 pur_voice, term_code, oper_code pur_date, user_code, meter_num, price_code, pur_power ,pur_money, pur_count, free_power, offer_money, left_money, write_card_pow  FROM dbo.pur_power_detail;";            SqlDataAdapter sda = new SqlDataAdapter(cmd);            DataSet ds = new DataSet();            sda.Fill(ds);            this.GridView1.DataSource = ds.Tables[0];            this.GridView1.DataBind();        }        catch (Exception ex)        {            throw ex;        }        finally        {            conn.Close();        }    }   }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.