Question :

i am trying to access the file path from code behind. but its stripping the whole file path.

aspx code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
using System.Data.SqlClient;
using System.IO;

public partial class _Default : System.Web.UI.Page
    public string url;
    protected void Page_Load(object sender, EventArgs e)

    protected void Button1_Click(object sender, EventArgs e)
        url = File1.Value;
       this.Page.ClientScript.RegisterStartupScript(this.GetType(),"testFunction", "show()", true);



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >

<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript">
        function show()

           var url = '<%=url%>';
    <form id="form1" runat="server">
        &nbsp;<input id="File1" runat="server" type="file" />
        <asp:Button ID="Button1" runat="server" OnClick= "Button1_Click" Text="click" />
    <object id="UserControl1" classid="CLSID:E646A84C-F475-41C5-A94E-7C45E264B3E2" codebase="..\bin\AOCX.CAB">

in alert(url) ; above i am not getting full file path can you please tell me whats missig ?

Answer :

try to find the Relative Path just do one thing when ever you want to check the relevant  path any of the file just drag and drop that file in any of the html File you will find the relevant  path and just use this....
This is the Standard Rule of the finding any file relative web page.....
Random Solutions  
programming4us programming4us