.NET Framework 클래스 라이브러리
ClientScriptManager.RegisterClientScriptBlock 메서드 (Type, String, String)
참고: 이 메서드는 .NET Framework 버전 2.0에서 새로 추가되었습니다.
형식, 키 및 스크립트 리터럴을 사용하여 클라이언트 스크립트를 Page 개체에 등록합니다.
네임스페이스: System.Web.UI
어셈블리: System.Web(system.web.dll)
어셈블리: System.Web(system.web.dll)
구문
Visual Basic(선언)
Public Sub RegisterClientScriptBlock ( _ type As Type, _ key As String, _ script As String _ )
Visual Basic(사용법)
Dim instance As ClientScriptManager Dim type As Type Dim key As String Dim script As String instance.RegisterClientScriptBlock(type, key, script)
C#
public void RegisterClientScriptBlock ( Type type, string key, string script )
C++
public: void RegisterClientScriptBlock ( Type^ type, String^ key, String^ script )
J#
public void RegisterClientScriptBlock ( Type type, String key, String script )
JScript
public function RegisterClientScriptBlock ( type : Type, key : String, script : String )
매개 변수
- type
-
등록할 클라이언트 스크립트의 형식입니다.
- key
-
등록할 클라이언트 스크립트의 키입니다.
- script
-
등록할 클라이언트 스크립트 리터럴입니다.
설명
클라이언트 스크립트는 해당 키와 형식에 의해 고유하게 식별됩니다. 키 및 형식이 같은 스크립트는 중복된 것으로 간주됩니다. 지정된 형식과 키 쌍을 사용하는 스크립트 하나만 페이지에 등록할 수 있습니다. 이미 등록된 스크립트를 등록하려고 하면 중복 스크립트가 만들어지지 않습니다.
지정한 키와 형식 쌍으로 클라이언트 스크립트가 이미 등록되어 있는지 여부를 확인하여 스크립트를 추가하려는 불필요한 시도를 방지하려면 IsClientScriptBlockRegistered 메서드를 호출합니다.
RegisterClientScriptBlock 메서드의 이 오버로드에서는 script 매개 변수에 제공된 스크립트가 <script> 요소 블록으로 래핑되어 있는지 확인해야 합니다.
RegisterClientScriptBlock 메서드는 렌더링된 페이지의 맨 위에 스크립트 블록을 추가합니다.
플랫폼
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0에서 지원참고 항목