SixBit.Web.CsJs.CsJsViewContext.GetScript C# (CSharp) Method

GetScript() private method

private GetScript ( ) : string
return string
        internal string GetScript()
        {
            return _builder.ToString();
        }

Usage Example

Example #1
0
        public virtual void Render(ViewContext viewContext, System.IO.TextWriter writer)
        {
            // We'll be writing out javascript
            viewContext.HttpContext.Response.ContentType = "text/javascript";

            // Wrap the code in a try/catch just to signal errors
            writer.WriteLine("try {");

            // Have the derived view render it's script into the context
            // then render it to the output stream
            var ctx = new CsJsViewContext(viewContext);
            Render(ctx);
            writer.Write(ctx.GetScript());

            // Close the script try/catch
            writer.Write("} catch(error) { alert('csjs error'); }");
        }
All Usage Examples Of SixBit.Web.CsJs.CsJsViewContext::GetScript