Export (0) Print
Expand All

Controller.JavaScript Method

Creates a JavaScriptResult object.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

'Declaration
Protected Friend Overridable Function JavaScript ( _
	script As String _
) As JavaScriptResult
'Usage
Dim script As String 
Dim returnValue As JavaScriptResult 

returnValue = Me.JavaScript(script)

Parameters

script
Type: System.String
The JavaScript code to run on the client

Return Value

Type: System.Web.Mvc.JavaScriptResult
The JavaScriptResult object that writes the script to the response.

This method is used to send JavaScript code that is created on the server to the client. The JavaScript is automatically run on the client. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.

Show:
© 2014 Microsoft