0

I want to open a dialog in an itemtemplate field of a gridview.

I have a linkbutton on my page and I want to open a jquery dialog when the linkbutton is clicked.

My code is:

<head>
    <script type="text/javascript">

    $(document).ready(function(){
    $('#LinkButton1').click(function(){

    $('#dialog').dialog({modal:true});
    });
    });
    </script>
</head>

<body>
    <form id="form1" runat="server">
    <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
    <div id="dialog">
        ABid ALi
    </div>
    </form>
</body>

Why is what I am doing not working?

The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
Abid Ali
  • 1
  • 1
  • 1

2 Answers2

0

You can try this. This is one of the simple implementation.

Javascript Code

function testFunction(){
           alert("test message");
         }

Server Side Code

<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="testFunction();">LinkButton</asp:LinkButton>

I hoe this helps.

inxss
  • 85
  • 2
  • 7
0

add

jquery-1.8.2.js and jquery-ui.js files

in head tag..

using this all jquery code and dialog will be accessible to the browser.

Rupali
  • 105
  • 2
  • 13