I am working on SP2010 with visual web part in C#. I have added one form dialog using jquery-ui. When I use it directly from .ascx, its working. But when I am calling it from code behind, its not showing up. It seems jquery ready function itself is not able to initialize.
This is my javascript code to generate popup:
$(document).ready(function () {
alert('readying function');
//setup new comments dialog
$('#newComment').dialog({
autoOpen: false,
draggable: true,
title: "Add New Comment",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
});
function showDialog(id) {
alert('Showing ' + id);
$('#' + id).dialog("open");
alert('did you see ' + id);
}
The popup before making dialog ready is coming up. But then dialog is not showing. I have ensured my script and jquery-us.css is embedded on top of the page. I am using jquery 1.9.1.
Am I making any mistake here? Such a simple thing is eating lot of time :(