Pass Parameter to Javascript

Discussion in 'ASP .Net Datagrid Control' started by Jay, Nov 28, 2005.

  1. Jay

    Jay Guest

    Sorry for cross post... also posted to aspnet.

    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.
     
    Jay, Nov 28, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay

    Pass Parameter to Javascript

    Jay, Nov 28, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    31,644
    Bruce Barker
    Nov 28, 2005
  2. Spartanicus
    Replies:
    4
    Views:
    1,415
  3. PhilTheGap
    Replies:
    6
    Views:
    14,699
    Steven Cheng [MSFT]
    Jun 13, 2008
  4. jaya
    Replies:
    1
    Views:
    204
    Teo Lachev [MVP]
    Nov 10, 2005
  5. AzamSharp
    Replies:
    2
    Views:
    203
Loading...

Share This Page