Skip to content

Commit 9f55135

Browse files
Update option.md
1 parent 507d0d7 commit 9f55135

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

doc/option.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ end_trim_in_aspx_file=true
1717
set_break_for_layout_page=true
1818
convert_cshtml_to_aspx=false
1919
show_minor_errors=false
20+
error_page_path=/error.aspx/{value}
21+
prevent_access_default_aspx=false
2022
```
2123

2224
**The possibility to load aspx page names as directory names**
@@ -138,9 +140,9 @@ In the options file, exist an option to support cshtml files so that users of th
138140

139141
You can code in these files with razor syntax and standard syntax.
140142
cshtml files will be available with aspx extension after compilation.
141-
For default cshtml pages, the name should be Default.cshtml; So pages named Index.cshtml will not be the default route.
143+
For default cshtml pages, the name should be Default.cshtml; so pages named Index.cshtml will not be the default route.
142144

143-
Please note that these files must not be added to projects in Visual Studio; The reason for this is that, in addition to the CodeBehind framework, these pages are also compiled in the default .NET mode and can create unstable situation and security risk conditions.
145+
Please note that these files must not be added to projects in Visual Studio; the reason for this is that, in addition to the CodeBehind framework, these pages are also compiled in the default .NET mode and can create unstable situation and security risk conditions.
144146
Also note that the default code highlighter of Visual Studio may in some cases have unnecessary errors from cshtml pages based on the CodeBehind framework.
145147

146148
Operation location: Compiling view files
@@ -154,3 +156,41 @@ By enabling the show minor errors option, when compiling, errors that do not cau
154156
In the future, more customization options will be added to the options file.
155157

156158
Operation location: Compiling view files
159+
160+
**Error page path**
161+
162+
(`error_page_path=/error.aspx/{value}`)
163+
164+
The default CodeBehind template includes an error page. In the options file, there is an option that determines the path of the error file; the path of the error page is set by default in this option. In the error page, we activated the page section attribute by default. If you look carefully at the path of the error page in the options file, you will see the value value surrounded by two brackets. This is a variant and the numeric value of the error replaces this variant.
165+
166+
Example
167+
`/error.aspx/500`
168+
169+
According to the path above, the value 500 is substituted for the {value} variant.
170+
171+
You can call up the error page according to the type of error.
172+
173+
The link below is a tutorial on how to configure the error page.
174+
175+
[Error handling](https://github.com/elanatframework/Code_behind/blob/elanat_framework/doc/error_handling.md)
176+
177+
Operation location: Every request
178+
179+
**prevent_access_default_aspx=false**
180+
181+
(`prevent_access_default_aspx=false`)
182+
183+
View files in CodeBehind framework have aspx extension; if you create a View file named Default.aspx in a directory, accessing the directory will execute that file. So Default.aspx is a default View for a directory path.
184+
185+
Example:
186+
If there is a `Default.aspx` file in the root, the `example.com` request executes the `example.com/Default.aspx` path.
187+
Similarly, if there is a `Default.aspx` file in `root/dir`, requesting `example.com/dir` will execute the `example.com/dir/Default.aspx` path.
188+
189+
However, the `Default.aspx` file path will still be accessible. Enabling this option disables access to the `Default.aspx` path.
190+
191+
Example:
192+
The path `example.com/dir/Default.aspx` will not be available, but the path `example.com/dir/` will still be accessible.
193+
194+
By activating this option, additional urls are prevented and thus SEO is improved.
195+
196+
Operation location: Every request

0 commit comments

Comments
 (0)