Pergunta

How can I write

var releaseName = $('#SelectedReleaseId option:selected').text()
var templateName = $('#SelectedTemplateId option:selected').text()

this:

$("#TestplanName").text(releaseName + '-' + templateName + '-' + '@Model.UserId' + '-' + '@Model.CreatedAt');

into:

$("#TestplanName").text( '@string.Format("{0}-{1}-{2}-{3}",releaseName,templateName,@Model.UserId,@Model.CreatedAt)');

The releaseName and templateName are unknown...

Foi útil?

Solução

You can't.

You're trying to mix client-side variables – which only exist in Javascript on the client – with server-side code.

Instead, you can use a Javascript equivalent of string.Format.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top