Friday, March 16, 2012

Passing a value to a JavaScript function from the database

Hi Steven,

Thanks for following up. I believe I have it working now, using the prior
suggestion.

On the C# side, my code looks roughly like this:

String scriptString = "<script language=JavaScript> ";
scriptString += "var ... ";
scriptString += "function FunctionName() {... document.Form1.strValue1.value
...}";
scriptString += "</script> ";

RegisterHiddenField("strValue1", "...");
RegisterHiddenField("strValue2", "...");

RegisterStartupScript("startup", scriptString);

It tests Ok, but I haven't put it into production yet.

Regards,
Scott

"Steven Cheng[MSFT]" <v-schang@dotnet.itags.org.online.microsoft.com> wrote in message
news:qPlTs2UoEHA.2640@dotnet.itags.org.cpmsftngxa06.phx.gbl...
> Hi Scott,
> Have you had a chance to check bruce's suggestions or have you got any
> further ideas on this issue? If you need any further assistance, please
> feel free to post here.Thanks.
>
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)Thanks for your followup Scott!

Anyway, if you have any problems in the future, please feel free to post
here. Thanks.
Have a good day!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

0 comments:

Post a Comment