views:

29

answers:

2

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

+3  A: 

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.

John Boker
`protected` will suffice!
Andreas Niedermair
fixed the answer to include that.
John Boker
A: 

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.

Sky Sanders