Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
onclick attribute not rendering
posted

I have an OnInitializeRow method associated with a WebDataGrid:

 

    protected void wdgKB_OnInitializeRow( object sender, Infragistics.Web.UI.GridControls.RowEventArgs e )
    {
       e.Row.CssClass = "IG_RowStyle UnderlineOnHover";
        e.Row.Attributes.Add( "onclick""alert( 'Got here' );" ); }
 
The code executes, I've stepped through it with the debugger and the CssClass is rendered, but when I check the source of the rendered page there is no onclick attribute.

Note: I've trivialized this example; obviously I need it to do something else besides pop up an alert; I need it to call a client-side javascript function with attributes.  I know how to do all of that, I just need to get it to render.

Any help would be appreciated.

JP
  • 30
    posted

    Sorry, my first post; didn't realize it wouldn't wrap:

     

    toolsmythe said:

    I have an OnInitializeRow method associated with a WebDataGrid:

     

        protected void wdgKB_OnInitializeRow( object sender, Infragistics.Web.UI.GridControls.RowEventArgs e )    
    {
            e.Row.CssClass = "IG_RowStyle UnderlineOnHover";

    
    

            e.Row.Attributes.Add( "onclick""alert( 'Got here' );" );
    }

    
    

    The code executes, I've stepped through it with the debugger and the CssClass is rendered,
    but when I check the source of the rendered page there is no onclick attribute.

    
    

    
    

    Note: I've trivialized this example; obviously I need it to do something else besides pop up
    an alert; I need it to call a client-side javascript function with attributes. I know how to do all
    of that, I just need to get it to render.

    
    

    
    

    Any help would be appreciated.

    
    

    
    

    JP