A Place for C Sharpers/.Netters

I Will do coding till last moment of life-Kiran Patil

Archive for the ‘Javascript’ Category

Object dosen’t support this property or method with showModalDialog

Posted by kiranpatils on January 11, 2010

Challenge:

We’re trying to open Modal Window from Modal Window on button click which is inside update panel:

protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(Button1, page.GetType(), "OpenModalDialog", "<script type=text/javascript>window.showModalDialog('http://www.gooogle.com, null, 'dialogHeight:100px;dialogWidth:280px;status:no'); </script>", false);
}

But it was giving an error Object dosen’t support this property or method

Solution:

Pls  check that pop-up blocker is not active. [Tools | Pop-Up Blocker|Turn-off Pop-up Blocker].

Posted in Javascript | Leave a Comment »

Insert Cell alternative for Firefox

Posted by kiranpatils on May 20, 2009

Hi folks Sorry for being invisible since so long. But i really got tied up with my bits. :)

Anyway today i have something to share with you all so here it is:

Challenge:

I have one JavaScript in which i am creating one table cell and adding it to table. It works fine in IE[As always :) ] But not in FF[As always :) ].

var newTable = document.createElement(‘table’);
var newRow = newTable.insertRow( ); 
 var newCell1 = newRow.insertCell( );

Solution:

So, finally my friend Google helped me to find a way:

just pass –1 to insertCell Method and have a good sleep!

var newTable = document.createElement(‘table’);
var newRow = newTable.insertRow( ); 
var newCell1 = newRow.insertCell( -1);

Reason:

I don’t know. If you do please do let me know :)

Happy Programming!

 

Posted in Javascript | Tagged: , | 4 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 102 other followers