Question : asp.net

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);

       
    }
}
---------------------------------------------------------------------------------------------

default.aspx

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >


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

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

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

Answer : asp.net

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 path...in web page.....
Random Solutions  
 
programming4us programming4us