Link to home
Create AccountLog in
Avatar of jrmcdona
jrmcdona

asked on

how to pass in a global javascript variable into a custom control property

Is it possible to pass in a global javascript variable into a custom control property?? I have been messing with this all day and cannot.

Something to this effect:

var jscriptvar = test;
<PGE:IsAdmin runat="server" Title="'+jscriptvar+'"/>



Or could I even pass in another custom control?

<PGE:IsAdmin runat="server" Title="<SP:Title runat="server" />" />

Avatar of Munti
Munti

Have not tried this but,  

<PGE:IsAdmin runat="server" Title="'+<script language='javascript' type='text/javascript'>document.write(jscriptvar)</script>+'"/>
ASKER CERTIFIED SOLUTION
Avatar of EtherZa
EtherZa

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Jesse Houwing
If you use the Page.RegisterHiddenField function the field will not be prepended with a clientid. It makes it easier to use it in Javascript.
Avatar of jrmcdona

ASKER

Thanks, I will give these a shot.

I am using SharePoint and modifying one of the aspx pages with some javascript. I am inserting my own custom control tag onto the page and then trying to pass in the javascript to the variable. I will let you all know how it goes.

thanks
jordan