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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. getting "Microsoft JScript runtime error: Object expected"

getting "Microsoft JScript runtime error: Object expected"

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptcssasp-netcom
5 Posts 3 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.
  • W Offline
    W Offline
    Wes Jones
    wrote on last edited by
    #1

    I'm using asp:GridView on a page that uses a Master Page, and I added a template field to grid so that I can pop up a window instead of taking them to a full page. When I click on the link that should call the script to open the popup, I get the error "Microsoft JScript runtime error: Object expected", & I haven't really seen any good answers online yet. I'm using this, pretty much as given @ this article: Popup window for the GridView[^] (slow traffic there so posting here) If anyone could provide a corretive assessment(ie: HELP!!!), that'd be great! My page source looks a bit like this:

            var popupWindow
            function openPopup(strOpen) {
                popupWindow = window.open(strOpen, 'DaaaaName', 'width=500, height=700, top=100, left=300');
                if (window.focus) popupWindow.focus();            
            }
    
     
    .....
       < Columns >
       ......
       
         < ItemTemplate >
          < a href="javascript:openPage('Ratings.aspx?ID=<%# Eval("ID") %>')">Rate it! 
         < /ItemTemplate>
       < /asp:TemplateField>
       < /Columns>
    ......
    < /asp:GridView>
    < /asp:Content>
    
    S D 2 Replies Last reply
    0
    • W Wes Jones

      I'm using asp:GridView on a page that uses a Master Page, and I added a template field to grid so that I can pop up a window instead of taking them to a full page. When I click on the link that should call the script to open the popup, I get the error "Microsoft JScript runtime error: Object expected", & I haven't really seen any good answers online yet. I'm using this, pretty much as given @ this article: Popup window for the GridView[^] (slow traffic there so posting here) If anyone could provide a corretive assessment(ie: HELP!!!), that'd be great! My page source looks a bit like this:

              var popupWindow
              function openPopup(strOpen) {
                  popupWindow = window.open(strOpen, 'DaaaaName', 'width=500, height=700, top=100, left=300');
                  if (window.focus) popupWindow.focus();            
              }
      
       
      .....
         < Columns >
         ......
         
           < ItemTemplate >
            < a href="javascript:openPage('Ratings.aspx?ID=<%# Eval("ID") %>')">Rate it! 
           < /ItemTemplate>
         < /asp:TemplateField>
         < /Columns>
      ......
      < /asp:GridView>
      < /asp:Content>
      
      S Offline
      S Offline
      SayreCC
      wrote on last edited by
      #2

      Hi, make sure after you close your popup you will alwys return a value to your page(gridview).

      W 1 Reply Last reply
      0
      • S SayreCC

        Hi, make sure after you close your popup you will alwys return a value to your page(gridview).

        W Offline
        W Offline
        Wes Jones
        wrote on last edited by
        #3

        Hello, If you mean I should return true; from my javascript function "openPopup", I've already tried that w/ no effect on the error msg I'm getting about "Object expected" Thanks

        1 Reply Last reply
        0
        • W Wes Jones

          I'm using asp:GridView on a page that uses a Master Page, and I added a template field to grid so that I can pop up a window instead of taking them to a full page. When I click on the link that should call the script to open the popup, I get the error "Microsoft JScript runtime error: Object expected", & I haven't really seen any good answers online yet. I'm using this, pretty much as given @ this article: Popup window for the GridView[^] (slow traffic there so posting here) If anyone could provide a corretive assessment(ie: HELP!!!), that'd be great! My page source looks a bit like this:

                  var popupWindow
                  function openPopup(strOpen) {
                      popupWindow = window.open(strOpen, 'DaaaaName', 'width=500, height=700, top=100, left=300');
                      if (window.focus) popupWindow.focus();            
                  }
          
           
          .....
             < Columns >
             ......
             
               < ItemTemplate >
                < a href="javascript:openPage('Ratings.aspx?ID=<%# Eval("ID") %>')">Rate it! 
               < /ItemTemplate>
             < /asp:TemplateField>
             < /Columns>
          ......
          < /asp:GridView>
          < /asp:Content>
          
          D Offline
          D Offline
          dotnetmember
          wrote on last edited by
          #4

          hey, I cant find any function openPage() defined in script.that is why, u r getting object expected error. may be u r trying to call openPopup() function. Happy coding.....

          W 1 Reply Last reply
          0
          • D dotnetmember

            hey, I cant find any function openPage() defined in script.that is why, u r getting object expected error. may be u r trying to call openPopup() function. Happy coding.....

            W Offline
            W Offline
            Wes Jones
            wrote on last edited by
            #5

            well hell, if that's not what it is. I love it when I do that. Thank you sir for your extra pair of eyes, it works as expected now.

            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