在弹出窗口中禁用右键单击

时间:2018-01-23 04:52:12

标签: c# asp.net treeview

如何在弹出窗口中禁用右键单击。我不希望用户在弹出窗口中保存或打印文档。这是我的界面Interface

这是我在TreeView1_SelectedNodeChanged

下的aspx.cs代码

 protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        if (Session["loggedUserID"] == null && Session["loggedRoleID"] == null)
        {
            Response.Redirect("~/Login.aspx");
        }


        else
        {
            if (TreeView1.SelectedNode.Parent == null)
            {

                ltEmbed.Visible = false;
            }

            else
            {
                ltEmbed.Visible = true;

                string Text = TreeView1.SelectedNode.Text.ToString();
               

                int loggedUserID = Convert.ToInt32(Session["loggedUserID"]);
                List<BOL.UserInfo> userslist = new UserInfos().List();
                BOL.UserInfo loggeduser = userslist.Where(x => x.UserID == loggedUserID).FirstOrDefault();
            
                BOL.DMS getdetail = new DMSS().GET_FILE(loggeduser.SUBSIDIARY_CD, Text);
                string FILE_NAME = getdetail.F_NAME;
                string FILE_PATH = getdetail.MAIN;
             
                
                 string url = String.Format(ResolveUrl(FILE_PATH));
 
                 string script = "window.open('" + url + "', '_blank','popup_window','width=700,height=600,left=100,top=100,resizable=false,oncontextmenu= return false');";
                 ClientScript.RegisterStartupScript(this.GetType(), "popUp", script, true);

                     
            }





        }


    }

谢谢。

0 个答案:

没有答案