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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Using QueryString Tokens in Text/HTMLUsing QueryString Tokens in Text/HTML
Previous
 
Next
New Post
12/6/2010 12:33 PM
 

Hi all,
I'm want to use QueryString Tokens on my page like the "Text/HTML Replacement Tokens" described in Appendix One of the Administration guide. It would be perfect to use something like [QueryString:ID] or [URL:ID] in the HTML-Module. I tried with <%= Request.QueryString["ID"]%> and some other formats too but can't get any value visible.

Target / example:
Put http://www.mydomain.com/testpage.aspx... into the browsers address
and on the opening page see:
"You got ID: 1234"

I'm sure this is not that complex to solve for a professional ... isn't it?

Thanks for help ... Horst
 
New Post
12/6/2010 1:18 PM
 
no, you cannot use inline code inside Richtext editor. There is querystring support in FnL module (which you may use instead), but it hasn't yet moved into the core framework.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
12/6/2010 1:46 PM
 
Hello Sebastian,
thanks for the short time reply! Good to know that I doesn't have to try more ways.

Could it be done with php or jscript? Think it is a common task to use querystrings in HTML.

Thanks for any help ... Horst
 
New Post
12/6/2010 2:14 PM
 
Several third party modules support Query string substitution.  For example SGSV (SqlGridSelectedView) will accept a query string variable when building a SQL Statement  For example

    Select * from Products where ProductID = [Query:ID:-1]

will subsitute ID as 

    Select * from Products where ProductID  = 1234

(If ID is not present then the value -1 would be used/)

SGSV would then display the Products rows returned in a grid. 

Hope this helps
Paul.
 
New Post
12/6/2010 2:28 PM
 

Hi Paul,
thanks for that hint!

In meantime I found a way doing it with javascript. This can be used at the HTML module.

The way is to switch to source view in rtf editor and put the following function at the most top position:

<script>
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
}
</script>

In the text you can put the function at any place and show the query string variable by it's name with the following code:
<script>document.write(getQueryVariable("querystringvariableidentifier"));</script>

For the example http://www.mydomain.com/test.aspx?ID=... this means the following HTML:
You got the ID: <script>document.write(getQueryVariable("ID"));</script>

Hope this helps others too ;-) ... Horst


 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Using QueryString Tokens in Text/HTMLUsing QueryString Tokens in Text/HTML


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