Covert Razor delegate syntax to WebForms

101 views Asked by At

I am trying to write this style of code from cassette using WebForms. Is this possible?

@{
var message = "Hello World!";
Bundles.AddInlineScript(
  @<script>
    if (someTest) {
        alert('@message');
    }
  </script>);
}

I haven't managed to find an example of using methods with the Func<Object, Object> parameter in WebForms. Or is this because this only allowed by the Razor view engine?

1

There are 1 answers

2
Jay Douglass On
<% Bundles.AddInlineScript("if (someTest) { ...") %>