Need to pass a variable with a cfdiv

Posted on 2013-11-20
Last Modified: 2013-11-20
I need to pass a url variable to the bind page in a cfdiv. Below is what I have but when it loads I receive the error: permission denied.

<cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

Thank you.
Question by:earwig75
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 52

Expert Comment

ID: 39663689
On which page?

The code you posted works fine as long as #url.meyKey# (is that a typo?) is defined on the page containing the CFDIV:

<!--- define variable you're passing --->
<cfset url.meykey = "testing">
<cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

<cfdump var="#URL#">

     _cf_containerId | thediv  
     mykey              |  testing

Author Comment

ID: 39663714
The first page, testPage.cfm has url.mykey in the URL already. I get an undefined message in IE.
LVL 52

Accepted Solution

_agx_ earned 500 total points
ID: 39663761
Well according to the error message "mykey" isn't in the URL already.  On "testPage.cfm", dump the URL scope before the CFDIV.  Does it contain "mykey"?

      <cfdump var="#URL#">
      <cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

Also double check the spelling of the variable name. Is it "myKey" or "meyKey"?

You may need to set a default value for it w/cfparam so that it always exists. I don't know which variable name is correct, so I'll use "myKey"

      <cfparam name="url.mykey" default="some default value here">
      <cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.mykey#" />
LVL 52

Expert Comment

ID: 39663784
> when it loads I receive the error: permission denied.

Wait a sec ... did you edit the question? That's a different error altogether. Can you please post the complete error message as well as the type of error (CF error, ajax logs, ....)

Author Closing Comment

ID: 39664350
It is working now. The error was different in Firefox than in IE so I thought it had changed.

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math ( While this method is not o…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question