Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

ASP.Net Core Error in AddHtmlAttribute


public void AddHtmlAttribute(string scope, string attributeName, string attributeValue)
{
SortedDictionary<string, string> attributes = new SortedDictionary<string, string>();
if (_htmlAttributes.ContainsKey(scope))
{
attributes = new SortedDictionary<string, string>(_htmlAttributes[scope]);
}
else
{
attributes = new SortedDictionary<string, string>();
}

attributes[attributeName] = attributeValue;
_htmlAttributes[scope] = attributes;
}

i keep on receiving this error

System.ArgumentException: 'An item with the same key has already been added. Key: [body, System.Collections.Generic.SortedDictionary`2[System.String,System.String]]'


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Metronic_asp.net-core_v8.2.8



Hi,

Sorry for the late reply.

We've double-checked this version but are still unable to reproduce the issue. Could you provide detailed steps to help us replicate the error?

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi,

Sorry for the late reply.

We checked the latest Metronic version and were unable to reproduce this error.
Could you please clarify which Metronic version you are using?

Also, please let us know if there are any specific steps to reproduce this error.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(