이봐, 난이 모두 여기에이 코드 :웹 UI 컨트롤 클래스에 전달되는
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "showNotifier", ";$(function() {showNotifier(3000,'#cf5050','" & msg & "');});", True)
난과 같이 클래스 파일 내부에 배치 걸려 :
Public Class topMsgNotifyer
Public Shared Sub show(ByVal delay As Integer, ByVal colorOfBox As String, ByVal message As String)
Try
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "showNotifier", ";$(function() {showNotifier(" & delay & ",'" & colorOfBox & "','" & message & "');});", True)
Catch ex As Exception
End Try
End Sub
End Class
그리고 물론 클래스 파일 안에있는 Me.Page에 문제가 있습니다.
내가이 일을하여 현재 페이지의 이름을 얻을 수 있습니다 : 페이지 자체에 호출 대신 asp.net 페이지에서 해당 클래스의 서브를 호출 할 때
Dim pageName = Path.GetFileName(Request.Path)
가 어떻게이 문제를 해결 할 수 있습니다?
페이지 개체를 어떻게 전달합니까? – StealthRT
권하지 않습니다. 페이지를 전달하고 기본 클래스를 만드는 것을 보여줄 수 있습니까? – TheGeekYouNeed
그게 효과가 있었어. 감사합니다 TheGeekYouNeed – StealthRT