c# - How to open a document onclick of linkbutton according -
i want open uploaded document in new window based on respective linkbutton id's. document saved full path in db.
<asp:linkbutton id="lnkstdres" runat="server" text='<%#eval("alias") %>' commandargument='<%#eval("idinst") %>' commandname="studentres" onclick="lnkstdres_click"></asp:linkbutton> protected void lnkstdres_click(object sender, eventargs e) { }
i have no idea how that. thank
if( ( file1.postedfile != null ) && ( file1.postedfile.contentlength > 0 ) ) { string fn = system.io.path.getfilename(file1.postedfile.filename); string savelocation = server.mappath("data") + "\\" + fn; try { file1.postedfile.saveas(savelocation); response.write("the file has been uploaded."); } catch ( exception ex ) { response.write("error: " + ex.message); //note: exception.message returns detailed message describes current exception. //for security reasons, not recommend return exception.message end users in //production environments. better put generic error message. } } else { response.write("please select file upload."); }
Comments
Post a Comment