George Johnston
George Johnston

Reputation: 32258

ASP.NET setting a javascript, jQuery setting from my code behind

I would like to set a value:

    $('#swfupload').swfupload({
        upload_url: "uploadResume.aspx",
        file_post_name: 'uploadfile',
        post_params : {"session_guid" : [HERE]}
    });

...where [HERE] is the placeholder for my value, from my code behind in ASP.NET before the page is rendered. I generate a guid, and I need that apart of the script on the page. How can I accomplish this?

Thanks, George

Upvotes: 0

Views: 207

Answers (2)

John Boker
John Boker

Reputation: 83719

if it's a public or protected variable you can do

'<%= session_guid %>'

where session_guid is the name of your public or protected variable.

Upvotes: 3

Sky Sanders
Sky Sanders

Reputation: 37084

IF the script is IN the markup just use <%= sessionGuid %>, if the script is included then set a var in a preceeding script tag and reference it in the upload.

Upvotes: 0

Related Questions