﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1544	Permission Denied	Mayank Parmar		"I get this error only some time and also can't findout the reason why it is coming. Because sometimes it comes too quickly and sometimes it never appears. I am professional developer and I have spent too much time to resolve this error. Now me and also my client is fruastated as after spending lot of time I haven't got solution. I am giving all my code below. Please check and advice.

I have 2 pages : CreateLetter.aspx and Selection.aspx

on CreateLetter.aspx I have FCKeditor <fckeditorv2:fckeditor id=""FCKeditor1"" runat=""server"" BasePath=""~/FCKeditor/"" Height=""500px""></fckeditorv2:fckeditor>

and also one button <input id=""inpbtnInsertMerge"" type=""button"" value=""Insert Merge Field"" onmousedown=""test()"" />

and here is JavaScript for this page :
<script type=""text/javascript"" language=""javascript"">
        function test()
        {
            var FCK = FCKeditorAPI.GetInstance('<%=FCKeditor1.ClientID %>') ;
            FCK.InsertHtml('{u_mergefield}');
            delete FCK;
            newwin=window.open('Selection.aspx',null,""left=300,top=100,height=400,width=200,status=yes,titlebar=no,toolbar=no,menubar=no,location=no"");
            newwin.focus();
        }
    </script>

Simply saying I am adding string ""{u_mergefield}"" in FCKeditor at cursor position on clicking of that button. And open second page as pop up.

On second page I am giving him selection of words to replace that word ""{u_mergefield}"".

It has 2 buttons for that.

<input id=""inpbtnFianl"" type=""button"" value=""Update"" onclick=""update();"" />
<input id=""inpbtnCancel"" type=""button"" value=""Cancel"" onclick=""cancel();"" />

and here is javascript for that

        function update()
        {
            var FCK = window.opener.FCKeditorAPI.GetInstance('ctl00_cph_FCKeditor1') ;
            var str = FCK.GetXHTML( true );
            if(document.getElementById('Radio1').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_fname}"")
            }
            else if(document.getElementById('Radio2').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_lname}"")
            }
            else if(document.getElementById('Radio3').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_bstreet}"")
            }
            else if(document.getElementById('Radio4').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_bcity}"")
            }
            else if(document.getElementById('Radio5').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_bstate}"")
            }
            else if(document.getElementById('Radio6').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_bzip}"")
            }
            else if(document.getElementById('Radio7').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_sstreet}"")
            }
            else if(document.getElementById('Radio8').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_scity}"")
            }
            else if(document.getElementById('Radio9').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_sstate}"")
            }
            else if(document.getElementById('Radio10').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_szip}"")
            }
            else if(document.getElementById('Radio11').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_hstreet}"")
            }
            else if(document.getElementById('Radio12').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_hcity}"")
            }
            else if(document.getElementById('Radio13').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_hstate}"")
            }
            else if(document.getElementById('Radio14').checked)
            {
                str=str.replace(/{u_mergefield}/g,""{u_hzip}"")
            }
            else
            {
                str=str.replace(/{u_mergefield}/g,"""");
            }
            FCK.SetHTML(str);
            delete str;
            delete FCK;
            window.close();
            return(false);
        }
        function cancel()
        {
            var FCK = window.opener.FCKeditorAPI.GetInstance('ctl00_cph_FCKeditor1') ;
            var str = FCK.GetXHTML( true );
            str=str.replace(/{u_mergefield}/g,"""");
            FCK.SetHTML(str);
            delete str;
            delete FCK;
            window.close();
            return(false);
        }

Now from the main when I click button ""Insert Merge Field"" it opens pop up and from here it updates that word on clicking ""update"" as per selectio. If I do same process for 4 or 5 times. It works perfectly but after some tries when I click ""Update"" button from Selection.aspx it gives that ""Permission Denied"" as JavaScript error in ""CreateLetter.aspx"" page.

It is also unbelievable for me that the error comes only some time and not some time.
But it happens. If you want to see I can send you screen shots or screen recorded video.

Please give some time for this and please reply.

Thanks in advance.

Regards,
Mayank Parmar
Software Developer

mayank.parmar@clariontechnologies.co.in 
Clarion Technologies
SEI CMMI Level 3 Company

4th Floor, Great Eastern Plaza, 
Airport Road, 
Pune- 411 006,
Maharashtra, India. 
Mobile: +91 9763210521
http://www.clariontechnologies.co.in/ 
"	Bug	closed	Normal		General	FCKeditor 2.5 Beta	invalid	Pending	
