JQuery 사용자 컨트롤(ASCX)할당 및 인터페이스 응용
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for ISetValable
/// </summary>
namespace Insus.NET
{
public interface ISetValable
{
void SetValue(string value);
}
}
위의 인 터 페 이 스 는 대상 을 실현 시 킨 후에 컨트롤 에 값 을 부여 할 수 있 도록 하 는 것 입 니 다.다음은 사용자 컨트롤 을 만 듭 니 다.사용자 컨트롤 의 ascx 는 레이 블 탭 을 설치 하여 페이지 에서 전 달 된 값 을 표시 합 니 다.실제 환경 에 서 는 간단 한 Label 컨트롤 이 아니 라 다른 컨트롤 이나 대상 일 수도 있 습 니 다.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InsusUc.ascx.cs" Inherits="InsusUc" %>
<asp:Label ID="LabelMessage" runat="server" Text=""></asp:Label>
은 ascx.cs 코드 에서 인 터 페 이 스 를 실현 해 야 합 니 다.인터페이스 실현 방법 에 있 는 매개 변 수 를 Label 의 Text 에 부여 해 야 합 니 다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Insus.NET;
public partial class InsusUc : System.Web.UI.UserControl,ISetValable
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void SetValue(string value)
{
this.LabelMessage.Text = value;
}
}
OK.인터페이스 와 사용자 컨트롤 을 만 들 었 으 니 웹 페이지 를 만들어 야 합 니 다.웹 메 서 드 방법:

