I have the following code:
List<HtmlMeta> metas = new List<HtmlMeta>();
foreach (Control c in this.Page.Header.Controls)
if (c.GetType() == typeof(HtmlMeta))
{
HtmlMeta meta = (HtmlMeta)c;
if (meta.Name == "CategoryID")
strMeta = meta.Content;
}
I created this custom meta tag:
<meta id ="CategoryID" name="CategoryID" content="35" />
I step through the code and break at if (meta.Name == "CategoryID")
It gets to the meta tag before this then shows meta.name ="" then exits loop. It never sees my custom meta tag.
The tag before this one is: <meta name="verify-v1" content="AtroutoUUTAiOHzlmZOap4a5YdzOByK5v9bzwpzPy60=" />
Now you may ask why would I do this. I am using DotNetNuke CMS, I need a way for the end user to put in a parameter needed for a query in the backend code. I cannot seem to put anything in the url , like a querystring off the link to get to the page, so I tried a meta tag, as they can add this in the settings of the page(tab) in dnn.
I have tried leaving out id in the tag and just name, but same issue.
I am looking forr a simple and non resource intense solution.
Any insight to this or workaround in dnn or ASP.net would be great.
Thanks in advance.