call JavaScript from Class file

Last post 08-28-2007 2:02 PM by Haissam. 1 replies.

Sort Posts:

  • call JavaScript from Class file

    08-28-2007, 7:42 AM

    in my web application I am binding the data using Infragistic grid dynamically.And I have to set the template column dynamically, for that I use a class file that decide which one is template column.So which one is template column i want to open a new window on every rowid click and display a .aspx page.but from class file I cannot call javaScript to open a new window. Can anyone please help me how can i do that.

  • Re: call JavaScript from Class file

    08-28-2007, 2:02 PM
    Answer
    • All-Star
      37,391 point All-Star
    • Haissam
    • Member since 10-05-2006, 2:25 AM
    • Beirut - Lebanon
    • Posts 5,632

    Try to use the below code in the RowChanged event handler

    System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

    page.ClientScript.RegisterStartupScript(this.GetType(),"open","window.open('WebForm2.aspx');",true);

    Where WebForm2.aspx is the page you want to open.

    HC

    Haissam Abdul Malak
    MCAD.NET
    | Blog |
Page 1 of 1 (2 items)