Solved

Need to pass a variable with a cfdiv

Posted on 2013-11-20
5
365 Views
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.
0
Comment
Question by:earwig75
  • 3
  • 2
5 Comments
 
LVL 52

Expert Comment

by:_agx_
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:

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

/mysite/mydir/mypage.cfm
MyPage.cfm
<cfdump var="#URL#">

result:
MyPage.cfm
struct
     _cf_containerId | thediv  
     mykey              |  testing
0
 

Author Comment

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

Accepted Solution

by:
_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"?

testPage.cfm
      <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"

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

Expert Comment

by:_agx_
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, ....)
0
 

Author Closing Comment

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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