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 8947775
In Process

The Archive Base Latest Questions

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

I have a user control in the code behind and I get SPListItem (which

  • 0

I have a user control in the code behind and I get SPListItem (which is a specific item from one SharePoint list). And I need place on my user control buttons to manage this item (edit and delete). Can I use any patterns, which repeat behaviour of standard SharePoint list command (edit in modal dialog, delete with prompt?)

By example, I can add in ascx file html code:

    <img src="/_layouts/images/fgimg.png" alt="" style="left:-0px !important;top:-128px !important;position:absolute;" /></span>&nbsp;
<a class="ms-addnew" id="idHomePageNewItem" href=".../_layouts/listform.aspx?PageType=8&amp;ListId={03C30976-7C6C-4815-8EB2-2793A97D2EC}&amp;RootFolder=" 
onclick="javascript:NewItem2(event, &quot;.../_layouts/listform.aspx?PageType=8&amp;ListId={03C30976-7C6C-4815-8EB2-72793A97D2EC}&amp;RootFolder=&quot;);javascript:return false;" 
target="_self">Add Item</a>

And this link work same as link button in standart sharepoint list view.
And I need add also “Delete Item” link and “Edit Item” link. (I know ItemID, list GUID and etc).

  • 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-15T12:51:13+00:00Added an answer on June 15, 2026 at 12:51 pm

    You can add the “delete” functionality by just adding the code for deletion in the code behind of the control, so this shouldn’t be an issue.

    To retrieve the url for the edit form you can use following code:

        /// <summary>
        /// Gets the edit form URL of the current item.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns></returns>
        public static string GetEditFormUrl(SPListItem item)
        {
            return string.Format("{0}/{1}?id={2}&ContentTypeID={3}", item.Web.Url, item.ParentList.Forms[PAGETYPE.PAGE_EDITFORM].Url, item.ID, item.ContentTypeId);
        }
    

    This allows you to navigate to the edit form. If you want it to display in a popup you can use the “SP.UI.ModalDialog.showModalDialog” functionality.

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

Sidebar

Related Questions

I have a user control which uses objects as inner properties (some code is
I have a user control with this code behind: /// <summary> /// The text
I have extended a server control (not a user control) and put the code
i have user control, which i render on several views. i want to show
I have a user control which I would like to add a dependency property
I have problem passing a variable from a main page containing a user control
(New to ASP.NET here.) I have a user control which should check for a
I am using an ASP.Net Web Application project. I have a user control which
I have this user control: <%@ Control Language=C# AutoEventWireup=true CodeBehind=cite.ascx.cs Inherits=cite %> with behind
The following code-behind binding works for the SmartFormView user control: View: <UserControl x:Class=CodeGenerator.Views.PageItemManageSettingsView xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation

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.