Click to See Complete Forum and Search --> : passing asp values in javascript function


Huzaifa
March 10th, 2003, 05:30 AM
hi

my index page has 3 frames
menu,header and content

depending on the link clicked i want to display the title in the header frame which i am able to do using javascirpt

problem
--------------
menu getting generated from the database.
In javascript event i am able to call the function.

how do i pass the value in the javascript function

if i pass
<%# DataBinder.Eval(Container.DataItem, "AppName") %>
as a parameter its gives an error


this is my code
menu.aspx

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
if ((obj=MM_findObj(objName))!=null) with (obj)
if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
else innerHTML = unescape(newText);
}


<asp:HyperLink class="dashlink" id=HyperLink1 Text='<%# DataBinder.Eval(Container.DataItem, "AppName") %>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"URLName") %>' runat="server" Target='main' Height="13" Font-Size="9" onClick="MM_setTextOfLayer('Layer1?banner','','<%# DataBinder.Eval(Container.DataItem, "AppName") %>');"/>


Appreciate ur time

thanks

huzaifa s.m