Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to put java script....

How to put java script....

Scheduled Pinned Locked Moved ASP.NET
javatoolshelptutorial
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    igaurav
    wrote on last edited by
    #1

    Hi all, I want to put this java script ["window.open('Organization.aspx','mywindow','width=750,height=600')"; ] in treeview event TreeView1_SelectedNodeChanged1 so that on click of every node or sub node this window would open.. help me out please thanx

    never let you down...always be happy..

    A H H 3 Replies Last reply
    0
    • I igaurav

      Hi all, I want to put this java script ["window.open('Organization.aspx','mywindow','width=750,height=600')"; ] in treeview event TreeView1_SelectedNodeChanged1 so that on click of every node or sub node this window would open.. help me out please thanx

      never let you down...always be happy..

      A Offline
      A Offline
      Amol 111
      wrote on last edited by
      #2

      try this

      if (!IsPostBack)
      {
      TreeNode Parentnode = new TreeNode("Home");
      TreeNode node = new TreeNode("Organization","","","'Organization.aspx","_blank");
      //node.NavigateUrl = "javascript:window.open('Organization.aspx','mywindow','width=750,height=600');";
      Parentnode.ChildNodes.Add(node);
      TreeView1.Nodes.Add(Parentnode);
      }

      I 1 Reply Last reply
      0
      • I igaurav

        Hi all, I want to put this java script ["window.open('Organization.aspx','mywindow','width=750,height=600')"; ] in treeview event TreeView1_SelectedNodeChanged1 so that on click of every node or sub node this window would open.. help me out please thanx

        never let you down...always be happy..

        H Offline
        H Offline
        himanshu2561
        wrote on last edited by
        #3

        Hi gaurav Try this

        if (!IsPostBack)
        {
        TreeView1.Attributes.Add("onclick", "javascript:window.open('Organization.aspx.aspx','mywindow','width=750,height=600');");
        }

        himanshu

        I 1 Reply Last reply
        0
        • A Amol 111

          try this

          if (!IsPostBack)
          {
          TreeNode Parentnode = new TreeNode("Home");
          TreeNode node = new TreeNode("Organization","","","'Organization.aspx","_blank");
          //node.NavigateUrl = "javascript:window.open('Organization.aspx','mywindow','width=750,height=600');";
          Parentnode.ChildNodes.Add(node);
          TreeView1.Nodes.Add(Parentnode);
          }

          I Offline
          I Offline
          igaurav
          wrote on last edited by
          #4

          not working properly... for my tree view. its only working for node "HOME" 's sun nod Organizatin.aspx i want it like i click ANY node or sub node then this popup windows appear. any way thanx a lot.

          never let you down...always be happy..

          1 Reply Last reply
          0
          • H himanshu2561

            Hi gaurav Try this

            if (!IsPostBack)
            {
            TreeView1.Attributes.Add("onclick", "javascript:window.open('Organization.aspx.aspx','mywindow','width=750,height=600');");
            }

            himanshu

            I Offline
            I Offline
            igaurav
            wrote on last edited by
            #5

            I want it in a way like if i click ANY node or sub node then this window wud appear. through your code even i click joints of nodes then this window is appearing.. Thank You

            never let you down...always be happy..

            H 1 Reply Last reply
            0
            • I igaurav

              I want it in a way like if i click ANY node or sub node then this window wud appear. through your code even i click joints of nodes then this window is appearing.. Thank You

              never let you down...always be happy..

              H Offline
              H Offline
              himanshu2561
              wrote on last edited by
              #6

              Hi, May be this solve your problem

              protected void TreeView1\_SelectedNodeChanged(object sender, EventArgs e)
              {
                  ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN\_WINDOW", "window.open( 'http://www.google.com','mywindow','width=750,height=600' );", true);
              
              }
              

              himanshu

              I 1 Reply Last reply
              0
              • H himanshu2561

                Hi, May be this solve your problem

                protected void TreeView1\_SelectedNodeChanged(object sender, EventArgs e)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN\_WINDOW", "window.open( 'http://www.google.com','mywindow','width=750,height=600' );", true);
                
                }
                

                himanshu

                I Offline
                I Offline
                igaurav
                wrote on last edited by
                #7

                protected void TreeView1_SelectedNodeChanged1(object sender, EventArgs e) { Response.Write("<script>window.open('group.aspx?id=" + TreeView1.SelectedValue + "','mywindow','width=200,height=200')</script>"); } This is the answer.. its working fine...!! thanx a lot.

                never let you down...always be happy..

                1 Reply Last reply
                0
                • I igaurav

                  Hi all, I want to put this java script ["window.open('Organization.aspx','mywindow','width=750,height=600')"; ] in treeview event TreeView1_SelectedNodeChanged1 so that on click of every node or sub node this window would open.. help me out please thanx

                  never let you down...always be happy..

                  H Offline
                  H Offline
                  httplover
                  wrote on last edited by
                  #8

                  TreeView1_SelectedNodeChanged1="NodeChg();" function NodeChg() { window.open('Organization.aspx','mywindow','width=750,height=600')"; } ------------------------------------- 看上面代码.

                  living none stoping.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups