Re: Pass Parameter to Javascript
- From: "Edwin Knoppert" <info@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 22:46:05 +0100
I did it through the (gridview's) row event.
Using findcontrol and adding the onclick there.
However, a few days ago this kind of syntax was posted, i haven't tried it
yet.
<asp:ImageButton id="x" OnClientClick=<%# "menu('" + Eval("TableId") +
"');return false;"%> />
Maybe it helps?
"Jay" <msnews.microsoft.com> schreef in bericht
news:OpCSvNG9FHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
>I have javascript that accepts 2 parameters like so...
>
> function showmsgbox(chkB, somestring)
> {
> xState=chkB.checked;
> if(xState)
> {
> chkB.parentElement.parentElement.style.backgroundColor='yellow';
> }
> else
> {
> chkB.parentElement.parentElement.style.backgroundColor='whitesmoke';
> }
>
> alert(somestring);
>
> }
>
> I need to pass the second parameter o the function from within a datagrid
> like so... Only problem is I keep getting many erros with my syntax. How
> can this be accomplished?...
>
> <asp:TemplateColumn>
> <ItemTemplate>
> <asp:CheckBox ID="chkBox1" onclick="javascript:HighlightRow(this, '<%#
> DataBinder.Eval(Container, "DataItem.column1") %>'');" runat="server"
> autopostback="False"/>
> </ItemTemplate>
> </asp:TemplateColumn>
>
> Thanks.
>
>
.
- Follow-Ups:
- Re: Pass Parameter to Javascript
- From: Edwin Knoppert
- Re: Pass Parameter to Javascript
- References:
- Pass Parameter to Javascript
- From: Jay
- Pass Parameter to Javascript
- Prev by Date: Re: Dynamically Creating Controls On A Page
- Next by Date: Re: Pass Parameter to Javascript
- Previous by thread: Pass Parameter to Javascript
- Next by thread: Re: Pass Parameter to Javascript
- Index(es):