javascript - How to access filepath in aspx page -


here have declared string variable on top of page below

public string path;               protected void viewfile(object sender, eventargs e)                         {                  path = (sender linkbutton).commandargument;                             this.page.clientscript.registerstartupscript(this.gettype(),"page_index_script","openpdf();",true);                 }  

and want access variable in aspx page inside script tag below

<script type="text/javascript">                 function openpdf() {                     var strmessage ='<%= path%>';                     var filepath = 'http://localhost:2878/your project name/' + strmessage;                 window.open(filepath , 'pdf');                 return true;             }         </script> 

but variable holds file path not including '/' treat filepath string , elinimate '/' path. need not elinimate .how possible? suppose filepath "file/admin/pms" gives me on alerting strmessage ,filepath "fileadminpms"


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -