Dynamic URL . <cfLocation url = ..............

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Dynamic URL . <cfLocation url = ..............

    I use Navigation bar on the page from Dreamweaver (First-Next-Previous-Last).
    I go to some page in the middle (for example page2:
    [url]http://localhost:8500/CMS/categoryRedact.cfm?PageNum_Recordset2=1&amp;record ID=1[/url]
    ) I want to edit some record on this page. I click icon ?Edit? to get page
    with Form to update this record. After updating this record I use
    <cflocation url='categoryRedact.cfm?recordID=#FORM.ProduitsID# '> to return to
    the page where was this record to check if record was updating. And I always
    get the First pagehttp://localhost:8500/CMS/categoryRedact.cfm?recordID=1 when
    I need the second (or third or others).:confused; How can I write dynamic
    cflocation url so that I will always return to the right page where updating
    record was? Please help.Thank you. :) Svetlana

    gfhdfhfgh Guest

  2. Similar Questions and Discussions

    1. CFlocation.
      I?m interested to know whether it?s good practice to write long CF coded pages or segment CF code into several different CF pages and use cflocation...
    2. cflocation and 301 redirects
      It works for me... Add CFABORT after your CFHEADER tag -- probably a CFLOCATION tag is executing after your CFHEADER tags and overwriting your...
    3. cflocation and 301 redirects
      I am looking for the same solution. When I try: <cfheader statusCode="301" statusText="Moved Permanently"> <cfheader name="Location"...
    4. cflocation
      Does anyone know a way to use cflocation to load a page into a specific target within a frameset? I am working with multiple framesets and I am...
    5. CFLocation and SSL
      I am moving someone on a site from a form on an http or https. I post to a page that queries a DB and then redirects based upon the form post. The...
  3. #2

    Default Re: Dynamic URL . <cfLocation url = ..............

    You need to bracket your CFLOCATION tag with a CFOUTPUT since you want to pas the value of FORM.ProduitsID.
    jdeline Guest

  4. #3

    Default Re: Dynamic URL . <cfLocation url = ..............

    Hi

    after updating the data you are redirecting the page using the cflocation
    ...right?
    check in the querystring whats the value you are getting.
    if you are getting 1 then it will take to you the first page.
    try to pass the another number and check it out...whether the page is coming
    or not..

    vkunirs Guest

  5. #4

    Default Re: Dynamic URL . <cfLocation url = ..............

    2 jdeline Thank you for the idea with CFOUTPUT . Can you give me please some
    example code how to do this? 2 vkunirs Yes, it is. How I already wrote I get
    the page [url]http://localhost:8500/CMS/categoryRedact.cfm?recordID=1[/url] It
    means I have to be on the First page if recordID=1 because value of
    #FORM.ProduitsID# is one. But I have Products with #ProduitsID# = 1 on the
    few pages with navigation. What I have to add to this code <cflocation
    url='categoryRedact.cfm?recordID=#FORM.ProduitsID# '> to redirect me inside
    value #ProduitsID# = 1 on the second or third page? Thank you

    gfhdfhfgh Guest

  6. #5

    Default Re: Dynamic URL . <cfLocation url = ..............

    To make things more understandable . Actualy I use this standart Navigation
    bar from Dreamweaver -----------------------------------

    <cfset MaxRows_Recordset2=3>
    <cfset
    StartRow_Recordset2=Min((PageNum_Recordset2-1)*MaxRows_Recordset2+1,Max(Recordse
    t2.RecordCount,1))>
    <cfset
    EndRow_Recordset2=Min(StartRow_Recordset2+MaxRows_ Recordset2-1,Recordset2.Record
    Count)>
    <cfset
    TotalPages_Recordset2=Ceiling(Recordset2.RecordCou nt/MaxRows_Recordset2)>
    <cfset QueryString_Recordset2=Iif(CGI.QUERY_STRING NEQ
    "",DE("&"&CGI.QUERY_STRING),DE(""))>
    <cfset
    tempPos=ListContainsNoCase(QueryString_Recordset2, "PageNum_Recordset2=","&")>
    <cfif tempPos NEQ 0>
    <cfset
    QueryString_Recordset2=ListDeleteAt(QueryString_Re cordset2,tempPos,"&")>
    </cfif>
    -------------------------------
    <table border="0" width="50%">
    <cfoutput>
    <tr>
    <td width="23%" align="center"> <cfif PageNum_Recordset2 GT 1>
    <a
    href="#CurrentPage#?PageNum_Recordset2=1#QueryStri ng_Recordset2#">First</a>
    </cfif> </td>
    <td width="31%" align="center"> <cfif PageNum_Recordset2 GT 1>
    <a
    href="#CurrentPage#?PageNum_Recordset2=#Max(Decrem entValue(PageNum_Recordset2),1
    )##QueryString_Recordset2#">Previous</a>
    </cfif> </td>
    <td width="23%" align="center"> <cfif PageNum_Recordset2 LT
    TotalPages_Recordset2>
    <a
    href="#CurrentPage#?PageNum_Recordset2=#Min(Increm entValue(PageNum_Recordset2),T
    otalPages_Recordset2)##QueryString_Recordset2#">Ne xt</a>
    </cfif> </td>
    <td width="23%" align="center"> <cfif PageNum_Recordset2 LT
    TotalPages_Recordset2>
    <a
    href="#CurrentPage#?PageNum_Recordset2=#TotalPages _Recordset2##QueryString_Recor
    dset2#">Last</a>
    </cfif> </td>
    </tr>
    </cfoutput>
    </table>

    gfhdfhfgh Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139