ratingcontrol.aspx.cs

来自「AJAX 应用 实现页面的无刷新」· CS 代码 · 共 49 行

CS
49
字号
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Services;
using AjaxControlToolkit;

public partial class Automated_RatingControl : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Rating1_Changed(object sender, RatingEventArgs e)
    {
        e.CallbackResult = ((Rating)sender).ID + ";" + e.Value + ";" + e.Tag;
    }
    protected void Rating3_Changed(object sender, RatingEventArgs e)
    {
        e.CallbackResult = ((Rating)sender).ID + ";" + e.Value + ";" + e.Tag;
    }
    protected void Rating2_Changed(object sender, RatingEventArgs e)
    {
        e.CallbackResult = ((Rating)sender).ID + ";" + e.Value + ";" + e.Tag;
    }
    protected void Rating4_Changed(object sender, RatingEventArgs e)
    {
        e.CallbackResult = ((Rating)sender).ID + ";" + e.Value + ";" + e.Tag;
    }

    protected void Rating5_Changed(object sender, RatingEventArgs e)
    {
        if (e.Value == "2")
        {
            Rating5.CurrentRating = 10;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?