Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6924341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:39:03+00:00 2026-05-27T10:39:03+00:00

I am creating a custom field in SharePoint 2007. I have seen other solutions

  • 0

I am creating a custom field in SharePoint 2007. I have seen other solutions where the current site URL was default value of a text field.

How can I get this current site URL?
I have got one answer whiches states that I shall use JavaScript, but where do I put the script?

I hope you can help.

BR

To answer 1

I am new to SharePoint and am not quiet sure where to put the java script. Normaly i just give the initial value to the field in the FieldEditor.cs file but how can I do this with the javascript?

Here follows a picute of my files.

enter image description here

I have tried to put it into FiledEditor.cs but this results in the value of myString is written in the top of the web page.

Here is my current code:

string myScript = "var currentUrl = document.URL; LabelLookupFieldTargetURLText.Text = currentUrl;";
Page.ClientScript.RegisterClientScriptBlock(LabelLookupFieldTargetURLText.GetType(), "LabelLookupFieldTargetURLTextJavaScript", myScript);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:39:04+00:00Added an answer on May 27, 2026 at 10:39 am

    I found the answer my self. I don’t need to use a java script. I can just use SPContext.Current.Site.Url

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Sitecore I have created a custom field (via this recipe: http://sdn.sitecore.net/Articles/API/Creating%20a%20Composite%20Custom%20Field/Adding%20a%20Custom%20Field%20to%20Sitecore%20Client.aspx ) The
I have mastered creating custom data types and adding fields with CCK. Then I
I have 2 custom fields in my WordPress system when creating new posts. One
I'm creating custom forum software for a site I'm building, which includes 2 tables
I am creating custom membership provider for my asp.net application. I have also created
Yeah. As the title says, I am tasked with creating custom field in user
Im creating a custom field in MVC3 (C#) that I would like to access
I am currently creating a custom e-commerce site (in php, but that's not really
I am createing an external facing SharePoint site which contains a number of custom
I'm creating some custom work items in TFS and the helptext field seems handy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.