episerver

Disable Visual Studio Web Server Directory Browsing

☆樱花仙子☆ 提交于 2019-12-01 22:38:26
问题 I'm using Visual Studio's built in web server to test and EPiServer applicaiton. When I have the app running in IIS, if I hit the root of the virtual directory, EPiServer will take over and server the defaul page to me. Using the Visual Studion server (which I am doing for license reasons with the SDK), it always gives me the 'Directory Listing' view of my site. Does anyone know how to configure this web server to not allow the directory listing/browsing? Additional Information: This problme

Persisting values across multiple controller actions

依然范特西╮ 提交于 2019-12-01 19:32:39
In my controller i have an ID to an object in a database, and multiple actions needs this id to access the object. This ID is fetched in the Index action and used to populate the view model. The way I get the ID is through an argument, which EPiServer (out CMS) passes the Index action, so I cant really get it anywhere else. My question is, is there any way to make this id accessible to my actions without the use a hidden field etc on the client side? Id like to avoid sending extra data as much as possible, and it isnt really a good solution. I'm not sure what you mean by "it isn't really a

EpiServer - Add block to a content area programmatically

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 04:45:17
I have a content area which will have some blocks, some attributes of these blocks must be initialized with data from a SQL query, so in the controller I have something like this: foreach (ObjectType item in MyList) { BlockData currentObject = new BlockData { BlockDataProperty1 = item.ItemProperty1, BlockDataProperty2 = item.ItemProperty2 }; /*Dont know what to do here*/ } What I need, is to work with currentObject as a block, and add it to a content area I have defined in another block. I tried using myContentArea.Add(currentObject) but it says it can't add an object into a content area

Correct way of using log4net (logger naming)

扶醉桌前 提交于 2019-11-30 10:11:38
问题 There are two ways of configuring and using log4net. First one is when I can configure my own appender and associated logger: <!-- language: xml --> <appender name="myLogAppender" type="log4net.Appender.RollingFileAppender" > <file value="Logs\myLog.log" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date %level - %message%n" /> </layout> </appender> <logger name="myLog"> <level value="All"></level> <appender-ref ref="myLogAppender" /> </logger> And then when I

Correct way of using log4net (logger naming)

a 夏天 提交于 2019-11-29 19:14:56
There are two ways of configuring and using log4net. First one is when I can configure my own appender and associated logger: <!-- language: xml --> <appender name="myLogAppender" type="log4net.Appender.RollingFileAppender" > <file value="Logs\myLog.log" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date %level - %message%n" /> </layout> </appender> <logger name="myLog"> <level value="All"></level> <appender-ref ref="myLogAppender" /> </logger> And then when I want to write something in log, I can do the following: ILog log = LogManager.GetLogger("myLog"); log.Info