Robert Green MBA
Robert Green MBA

Reputation: 1876

MVC3 Razor Camtasia Video Embedding, @ param Error :-(

Greetings Community!

            <object id="myExperienceXXXXXXXX" class="BrightcoveExperience">
              <param name="bgcolor" value="#FFFFFF" />
              <param name="width" value="448" />
              <param name="height" value="251" />
              <param name="playerID" value="XXXXXXXXXX" />
              <param name="playerKey" value="XXXXXXXXXXX" />
              <param name="isVid" value="true" />
              <param name="dynamicStreaming" value="true" />
              <param name="@videoPlayer" value="XXXXXXXXXXXXX" />
            </object>

Notice the last line , I get the following error:

Compiler Error Message: CS0103: The name 'videoPlayer' does not exist in the current context

This value is Required by Camtasia to embed my video in my page. I'm sure there is a simple solution, but I need the "@" sign before the videoPlayer value.

Thanks in advance for any assistance.

Upvotes: 0

Views: 662

Answers (3)

Lei Feng
Lei Feng

Reputation: 21

Not work with the above answers!

It should be the format like this:

<param name="@("@videoPlayer")" value="XXXXXXXXXXXXX" />

Upvotes: 2

Only Bolivian Here
Only Bolivian Here

Reputation: 36753

The @ symbol is a reserved character in the Razor view engine. If you want to output a @ symbol you can use two @ characters to escape the first.

For example:

<param name="@@videoPlayer" value="XXXXXXXXXXXXX" />

Upvotes: 2

Darin Dimitrov
Darin Dimitrov

Reputation: 1038990

@ is a reserved character in Razor which should normally be followed by a server side expression. Double it if you want to output it literally:

<param name="@@videoPlayer" value="XXXXXXXXXXXXX" />

Upvotes: 3

Related Questions