#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Interpretting URLs


    We have an old classic ASP application that pulls a URL from an MSSQL database and we've had people recently ask about the URL, when clicked, going to a relative path. So, we'd have a URL of http://ourdomain.com/db_url and of course that link wouldn't exist.

    I need to fix that output to the browser window, so that if a user clicks the URL, it takes them to the actual URL.

    What I have in place, that works is:

    Code:
    <%Dim strURL
    strURL = objProfile.FieldValue("pro_url")
    strURL = Replace(objProfile.FieldValue("db_url"),"http://","",1,1,1)
    %>
    Then to display, I have:

    Code:
    <a href="http://<%=Response.Write(strURL)%>" target="_new"><%=objProfile.TextField("db_url",Adminedit,,50,50)%></a>
    So, that Replace function works perfect, but what I've run into now, is that I can no longer edit the URL from the web application.

    Before this issue, I had this in place:

    Code:
    <a href="http://<%=objProfile.TextField("db_url",noedit,,50,50)%>" target=_new"><%=objProfile.TextField("db_url",Adminedit,,50,50)%></a>
    This section,
    Code:
    <%=objProfile.TextField("db_url",noedit,,50,50)%>
    when in edit mode, gives the user an editable field.

    I've tried various forms and combinations to try and get the edit function back with no luck.

    Is there a better way to do this? Or, is there a way to modify this so I can edit again?

    Thanks
    Scott
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,430
    Rep Power
    4539
    This must be a problem with your application somewhere, asp doesn't have any built-in edit fields.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by Doug G
    This must be a problem with your application somewhere, asp doesn't have any built-in edit fields.
    Ok - that I'm not aware of. However, the original developers of the application used code to put editing in as a feature.

    Thanks
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,430
    Rep Power
    4539
    Review the code that generates the editable field. What is the objProfile object?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by Doug G
    Review the code that generates the editable field. What is the objProfile object?
    Doug - I was able to solve the issue just a bit ago.

    Using the editing as designed, I set the application so that when a user is viewing the site, the URL does what it should.

    Then, when in edit mode, I set that as an "else statement" with the edit parameters.

    I'm going to review some of the admin-type pages so I can see how they set the application up to allow editing, etc.

    Thanks for your assistance.

IMN logo majestic logo threadwatch logo seochat tools logo