I have this code in my .ascx.cs file which calls to new page on href.
lblVideoAssessment.Text = "<a href='../SitePages/Assessment.aspx?cat=" + cat + "' height='300px' width='300px' Target='_blank' cssClass='IconDisplayCss'><img src='~/_layouts/images/Assessment.png' border='none'/></a><br/>" + cat;
I want to replace this code to javascript popup page to change look and feel.i want to make page as popup for which i have written a javascript method in .ascx file which is given below:
<script type="text/javascript">
function OpenDialog(URL) {
var NewPopUp = SP.UI.$create_DialogOptions();
NewPopUp.url = URL;
NewPopUp.width = 700;
NewPopUp.height = 350;
SP.UI.ModalDialog.showModalDialog(NewPopUp);
}
</script>
I have called the javascript in code behind like this and it does not work:
lblVideoAssessment.Text = "<a OnClick='javascript:OpenDialog('../SitePages/Quiz.aspx')' height='300px' width='300px' Target='_blank' cssClass='IconDisplayCss'><img src='~/_layouts/images/Assessment.png' border='none'/></a><br/>" + cat;
Please advice what to do. The same works fine with sharepoint designer. Please help how to pass the javascript method on OnClick.