c# - Root folder file not getting in App_Code folder -


i using code below root folder html file in app_code folder

using (streamreader reader = new streamreader(httpcontext.current.server.mappath("~/emailtemplate.html"))) { ... } 

but im getting error

object reference not found !!

can 1 me..

so way wrote first line, can tell you're using class not in code-behind. so, similar rules apply how server.mappath works.

i think you'll need rid of tilde , replace relative path. see httpserverutility.mappath method


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -