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

  • Home
  • SEARCH
  • 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 8659963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:08:15+00:00 2026-06-12T16:08:15+00:00

I have the following .cs file; using System; using System.Collections.Generic; using Sitecore.Data; using Sitecore.Data.Items;

  • 0

I have the following .cs file;

using System;
using System.Collections.Generic;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Events;
using Sitecore.SecurityModel;

namespace LocationItemEventHandler
{
    public class ItemEventHandler
    {
        private static readonly SynchronizedCollection<ID> MProcess = new SynchronizedCollection<ID>();

        /// <summary>
        /// This custom event auto-populates latitude/longitude co-ordinate when a location item is saved
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        protected void OnItemSaved(object sender, EventArgs args)
        {
            var item = Event.ExtractParameter(args, 0) as Item;

            if (item != null && !MProcess.Contains(item.ID))
            {
                if (item.TemplateID.Equals("{E490971E-758E-4A75-9C8D-67EC2C6321CA}"))
                {
                    string errMessage = "";
                    string responseCode = "";
                    string address = item.Fields["Address"].Value;
                    if (1=1)
                    {
                        string latitude = "100";
                        string longitude = "200";

                        MProcess.Add(item.ID);

                        try
                        {
                            var latlngField = item.Fields["Google LatLng"];
                            using (new SecurityDisabler())
                            {
                                item.Editing.BeginEdit();
                                latlngField.SetValue(latitude + " - " + longitude, true);
                                Sitecore.Context.ClientPage.ClientResponse.Alert(
                                string.Format(
                                "Fields updated automatically\r\nLatitude: {0}\r\nLongitude: {1}",
                                latitude, longitude));
                                item.Editing.EndEdit();
                            }
                        }
                        catch (Exception exception)
                        {
                            Log.Error(exception.Message, this);
                        }
                        finally
                        {
                            MProcess.Remove(item.ID);
                        }
                    }
                }
            }
        }
    }
}

This is in a code file LocationItemEventHandler.cs in App_Code.
this is in the web.config

<event name="item:saved">
<handler type="LocationItemEventHandler.ItemEventHandler, LocationItemEventHandler" method="OnItemSaved"/>
</event>

When i try to save an item i get a “Could not resolve type name”.

What am i missing?

  • 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-06-12T16:08:16+00:00Added an answer on June 12, 2026 at 4:08 pm

    The class name you have configured does not match the actual class name.

    Edit:
    If the handler is in App_Code, i believe you should leave off the assembly name in the type reference. Better yet, don’t use App_Code.

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

Sidebar

Related Questions

I currently have a class file with the following enumeration: using System; namespace Helper
I have the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using
I have in my funcs.cs file: using System; using System.Collections.Generic; using System.Web; public static
When I using the following code to read file: lines=file(data.txt).read().split(\n) I have the following
I have this code that is working fine for me: using System; using System.Collections.Generic;
I have the following file and I am using an iterator block to parse
I have the following code which outputs an object to an XML file: using
I have a class which loads an xml file using the following: Path.Combine( AppDomain.CurrentDomain.BaseDirectory,
I have to write a biginteger into a text file using the following statement.
In a web project using jsp, I have following requirement Upload a file (say

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.