Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How do I retrieve a custom meta tag in a page?How do I retrieve a custom meta tag in a page?
Previous
 
Next
New Post
3/2/2010 1:42 PM
 

 

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:

 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.

Now you may ask why would I do this, 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.


Thank you,
James Campbell
MCP,MCSA,MCSE,Sec +
http://jamesecampbell.blogspot.com
 
New Post
3/2/2010 4:18 PM
 

Maybe I am goining about this all wrong, let me explain my situation:

I have a page with many modules. Each module relies on the page's categoryid. How can I static this in the tab so all modules will see it, and still allow the end user to edit this ID?


Thank you,
James Campbell
MCP,MCSA,MCSE,Sec +
http://jamesecampbell.blogspot.com
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How do I retrieve a custom meta tag in a page?How do I retrieve a custom meta tag in a page?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out