MenuItem Url to a new Window or a new Tab?

Is there a way to open the MenuItem Url to a new Window or Tab? SfMenu.Target = "_blank" and MenuItem.HtmlAttributes doesn't work.


1 Reply

KV Keerthikaran Venkatachalam Syncfusion Team March 13, 2024 09:15 AM UTC

Hi Mark,


We have prepared samples based on the requirements. Please refer to the below code snippet and sample. Please refer to the below code snippet and sample.


@using Syncfusion.Blazor.Navigations

 

<SfMenu TValue="MenuItem">

  <MenuItems>

    <MenuItem Text="Appliances">

      <MenuItems>

        <MenuItem Text="Washing Machine" Url="https://www.google.com/search?q =washing+machine" HtmlAttributes="attributes"></MenuItem>

     </MenuItems>

    </MenuItem>

  </MenuItems>

</SfMenu>

 

@code{

 

  private Dictionary<string, object> attributes = new Dictionary<string, object>() {

  { "anchor", new Dictionary<string, object>() {

      { "target", "_blank" }}}

  };

 

}



Please let us know if you need any further assistance on this.


Regards,

KeerthiKaran K V


Loader.
Up arrow icon