Design View


Code View


Ref : here

use iframe to show your pdf file.
use paramater"#toolbar=0" to hide the toolbar of pdf file after you url ends
e.g.
src="sdsd/sdsd.pdf#toolbar=0"

xp_cmdshell 'IF EXIST D:\Delete\Delete.txt. del D:\Delete\Delete.txt.'

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    DataTable dt = new DataTable("Menu");
    protected void Page_Load(object sender, EventArgs e)
    {
        dt.Columns.Add("MenuId");
        dt.Columns.Add("MenuName");
        dt.Columns.Add("ParentMenuId");
        dt.Columns.Add("NavigationUrl");
        dt.Rows.Add(new string[] { "1","Home","0","http://www.google.com" });
        dt.Rows.Add(new string[] { "2", "Sub_Home_1", "1", "http://www.yahoo.com" });
        dt.Rows.Add(new string[] { "3", "About Us", "0", "http://www.reliancemoney.com" });
        dt.Rows.Add(new string[] { "4", "Sub_AboutUs_1", "3", "http://www.relince.com" });
        dt.Rows.Add(new string[] { "5", "Sub_AboutUs_2", "3", "http://www.codeproject.com" });
        dt.Rows.Add(new string[] { "6", "Contact Us", "0", "http://www.sqlauthority.com" });
        dt.Rows.Add(new string[] { "7", "Sub_Contact Us_1", "6", "http://www.crm.com" });
        dt.Rows.Add(new string[] { "8", "Sub_Sub_Contact Us_1", "7", "http://www.firebug.com" });
        dt.Rows.Add(new string[] { "9", "Sub_Sub_Home_1", "2", "http://www.dotnet.com" });
        ShowMenu(mnuTest.Items,0);
    }

    private void ShowMenu(MenuItemCollection nodes, int parentMenuId)
    {
        int MenuID;
        string MenuName, Url = string.Empty;
       
        DataRow[] ChildMenu = dt.Select("parentMenuId='" + parentMenuId + "'");
        if (ChildMenu.Length == 0) return;
        foreach (DataRow child in ChildMenu)
        {
            MenuID = Convert.ToInt32(child.ItemArray[0]);
            MenuName = Convert.ToString(child.ItemArray[1]);
            Url = Convert.ToString(child.ItemArray[3]);
            MenuItem NewNode = new MenuItem(MenuName, MenuID.ToString(),string.Empty,Url);
            nodes.Add(NewNode);
            ShowMenu(NewNode.ChildItems, MenuID);
        }
    }
}

Response.Redirect(path, "_blank", "menubar=0"); 
 
And add the below class 
 
public static class ResponseHelper 
public static void Redirect
(this HttpResponse response, string url, string target, string windowFeatures) 
if ((String.IsNullOrEmpty(target) || 
target.Equals("_self", StringComparison.OrdinalIgnoreCase)) && 
String.IsNullOrEmpty(windowFeatures)) 
{ response.Redirect(url); } 
else { Page page = (Page)HttpContext.Current.Handler; 
if (page == null) 
throw new InvalidOperationException(
"Cannot redirect to new window outside Page context."); } 
url = page.ResolveClientUrl(url); 
string script; 
if (!String.IsNullOrEmpty(windowFeatures)) 
{ script = @"window.open(""{0}"", ""{1}"", ""{2}"");"; } 
else { script = @"window.open(""{0}"", ""{1}"");"; } 
script = String.Format(script, url, target, windowFeatures); 
ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true); 
} } } 
 
 
OR
Use Java Script
ScriptManager.RegisterStartupScript(this.Page, typeof(Page), 
"Redirect", "window.open('Default.aspx', '_blank', 'menubar=0, width=906, 
height=550, scrollbars=1, status=0');", true); 

Upload only pdf files using Fileupload

  
 

if (fuUpload.HasFile)
                {
                    string FilePath = Server.MapPath("~/App_Data/Articles/");
                    string FileName = Path.GetFileName(fuUpload.FileName);
                    fuUpload.SaveAs(FilePath + FileName);
                }

If you are using FileUpload control inside Update Panel then use triggers