Skip to content

Commit b08d696

Browse files
committed
Add documentation for HyperLink and Menu components; update navigation structure
1 parent ef63e40 commit b08d696

6 files changed

Lines changed: 69 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ There are a significant number of controls in ASP.NET Web Forms, and we will foc
3232
- [DropDownList](docs/EditorControls/DropDownList.md)
3333
- FileUpload
3434
- [HiddenField](docs/EditorControls/HiddenField.md)
35-
- [HyperLink](docs/EditorControls/HyperLink.md)
3635
- [Image](docs/EditorControls/Image.md)
3736
- [ImageButton](docs/EditorControls/ImageButton.md)
3837
- ImageMap
@@ -69,7 +68,8 @@ There are a significant number of controls in ASP.NET Web Forms, and we will foc
6968
- [RequiredFieldValidator](docs/ValidationControls/RequiredFieldValidator.md)
7069
- [ValidationSummary](docs/ValidationControls/ValidationSummary.md)
7170
- Navigation Controls
72-
- [Menu](docs/Menu.md)
71+
- [HyperLink](docs/NavigationControls/HyperLink.md)
72+
- [Menu](docs/NavigationControls/Menu.md)
7373
- SiteMapPath
7474
- [TreeView](docs/NavigationControls/TreeView.md)
7575
- Login Controls
File renamed without changes.

docs/Menu.md renamed to docs/NavigationControls/Menu.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,5 +341,56 @@ The Menu component is meant to emulate the asp:Menu control in markup and is def
341341

342342
## Blazor Syntax
343343

344+
```html
345+
<Menu id="NavigationMenu"
346+
DisappearAfter="2000"
347+
StaticDisplayLevels="2"
348+
StaticSubmenuIndent="10"
349+
orientation="Vertical"
350+
font-names="Arial"
351+
target="_blank">
352+
353+
<StaticMenuItemStyle BackColor="@("LightSteelBlue")"
354+
ForeColor="@("Black")" />
355+
<StaticHoverStyle BackColor="WebColor.LightSkyBlue" />
356+
<DynamicMenuItemStyle BackColor="WebColor.Black"
357+
ForeColor="WebColor.Silver" />
358+
<DynamicHoverStyle BackColor="WebColor.LightSkyBlue"
359+
ForeColor="WebColor.Black" />
360+
<DynamicSelectedStyle BackColor="WebColor.PapayaWhip"
361+
ForeColor="WebColor.SteelBlue" />
362+
363+
<Items>
364+
<MenuItem navigateurl="Home.aspx"
365+
text="Home"
366+
tooltip="Home">
367+
<MenuItem text="Music" tooltip="Music">
368+
<MenuItem navigateurl="Classical.aspx"
369+
text="Classical"
370+
tooltip="Classical" />
371+
<MenuItem navigateurl="Rock.aspx"
372+
text="Rock"
373+
tooltip="Rock" />
374+
<MenuItem navigateurl="Jazz.aspx"
375+
text="Jazz"
376+
tooltip="Jazz" />
377+
</MenuItem>
378+
<MenuItem navigateurl="Movies.aspx" text="Movies" tooltip="Movies">
379+
<MenuItem navigateurl="Action.aspx"
380+
text="Action"
381+
tooltip="Action" />
382+
<MenuItem navigateurl="Drama.aspx"
383+
text="Drama"
384+
tooltip="Drama" />
385+
<MenuItem navigateurl="Musical.aspx"
386+
text="Musical"
387+
tooltip="Musical" />
388+
</MenuItem>
389+
</MenuItem>
390+
</Items>
391+
392+
</Menu>
393+
```
394+
344395
##### [Back to top](#menu)
345396

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ nav:
6969
- CheckBoxList: EditorControls/CheckBoxList.md
7070
- DropDownList: EditorControls/DropDownList.md
7171
- HiddenField: EditorControls/HiddenField.md
72-
- HyperLink: EditorControls/HyperLink.md
7372
- Image: EditorControls/Image.md
7473
- ImageButton: EditorControls/ImageButton.md
7574
- Label: EditorControls/Label.md
@@ -95,6 +94,8 @@ nav:
9594
- RequiredFieldValidator: ValidationControls/RequiredFieldValidator.md
9695
- ValidationSummary: ValidationControls/ValidationSummary.md
9796
- Navigation Controls:
97+
- HyperLink: NavigationControls/HyperLink.md
98+
- Menu: NavigationControls/Menu.md
9899
- TreeView: NavigationControls/TreeView.md
99100
- Login Controls:
100101
- Login: LoginControls/Login.md

samples/AfterBlazorServerSide/Pages/ControlSamples/Menu/DynamicMenuStyleSample.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@using static BlazorWebFormsComponents.WebColor
1+
@page "/ControlSamples/Menu/DynamicMenuStyleSample"
2+
@using static BlazorWebFormsComponents.WebColor
23
@using static BlazorWebFormsComponents.Enums.BorderStyle
34

45
<h3>DynamicMenuStyle Sample</h3>

src/BlazorWebFormsComponents/wwwroot/js/Basepage.module.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ export function onAfterRender() {
1414
formatClientClick();
1515
}
1616

17+
export function addScriptElement(location, callback) {
18+
var el = document.createElement("script");
19+
el.setAttribute("src", location);
20+
document.head.appendChild(el);
21+
22+
if (callback != null) {
23+
el.addEventListener("load", function () { eval(callback); });
24+
}
25+
}
26+
1727
function formatClientClick() {
1828
var elementsToReplace = document.querySelectorAll("*[onclientclick]");
1929
for (var el of elementsToReplace) {
@@ -31,6 +41,7 @@ if (typeof window !== 'undefined') {
3141
window.bwfc.Page = {
3242
setTitle,
3343
getTitle,
34-
OnAfterRender: onAfterRender
44+
OnAfterRender: onAfterRender,
45+
AddScriptElement: addScriptElement
3546
};
3647
}

0 commit comments

Comments
 (0)