Patrick.O.Ige

Knowledge Creation is Essential to Business, and Communication is Essential to Knowledge Creation

  Home  |   Contact  |   Syndication    |   Login
  97 Posts | 5 Stories | 350 Comments | 0 Trackbacks

News

SharePoint SharePoint SharePoint

Article Categories

Archives

Post Categories

ADO.NET

Ajax

API/WebServices

ASP.NET Resources

BizTalk Server

Blogs I read

Free Books

How to

JQuery

LINQ

Misc

Mobile BI

Reporting Services

SEO

Sharepoint Resources/Tools

SharePoint 2010 Branding

SharePoint 2010 Videos

SilverLight

SQL Server

Sql Server 2012

SSIS

Web Performace Tools

Windows Phone

WorkFlows

WSS V3

xml

How doing some asp.net deevelopment and i decided to use one of the asp.net controls.
But need to use Jquery to do some extra stuff

I had a link in the page i wanted to let popup like a modal dialog like so:

<td><a id="mdialog" href="details.aspx?scode=<%# Eval("Code")%>">[..]</a></td>

Then refrenced Jquery like so:

 <script type="text/javascript">
     $(document).ready(function () {
         $("#mdialog]").fancybox({
             'width': '75%',
             'height': '100%',
             'autoScale': false,
             'transitionIn': 'none',
             'transitionOut': 'none',
             'type': 'iframe'
         });


     });

  </script>

No matter what i did the popup never fired or funny enough sometimes it worked sometimes not.
Until i tried

 $("[id$=mdialog]").fancybox({
             'width': '75%',
             'height': '100%',
             'autoScale': false,
             'transitionIn': 'none',
             'transitionOut': 'none',
             'type': 'iframe'
         });

And it worked

So the code  finds all the DOM elements whose ID ends with 'mdialog' and wire up the following click event handler".

Hope that helps

posted on Monday, April 18, 2011 6:40 PM