Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes
Accepted

How to use ASP.NET button click event in SharePoint Web Part

I am pre-assuming that you are adding this in your user control or visual web part. You can add button click event in various methods: C# Your HTML part: <asp:Button id="Button1" Text="Click ...
Dikesh Gandhi's user avatar
3 votes
Accepted

How can I get data from a sharepoint 2010 server from a separate asp.net web application?

Is there a way I could get the data from the SharePoint web application from my asp.net app without installing SharePoint foundation on the asp.net server? Yes, you can read data from SharePoint in ...
Mohamed El-Qassas MVP's user avatar
3 votes
Accepted

get Dropdown selected value SharePoint 2013

To get a SharePoint Choice Field value SPFieldChoice myChoicesfield = (SPFieldChoice)list.Fields["FieldName"]; for (int i = 0; i < myChoicesfield.Choices.Count; i++) { ...
Mohamed El-Qassas MVP's user avatar
3 votes

get Dropdown selected value SharePoint 2013

From where DropDown1 came? In your code you are adding items in DropDownList4 and you are trying to access the value from DropDown1. Your code should be like: string selectedvalyear = Convert....
Aakash Maurya's user avatar
3 votes
Accepted

My dropdown won't work after I exported the gridview to excel file?

Because you have called the Response.End(), which ends the page execution, the body onload event would never be fired. The problem is sharepoint catches form submits and downloads so you cannot double ...
P S's user avatar
  • 4,817
3 votes
Accepted

How to properly use GridView to create items on SharePoint Lists?

Try below code private void AddGridRecords(int ID) { try { SPWeb web = SPContext.Current.Web; SPList List = web.Lists["FORM D List"]; web....
P S's user avatar
  • 4,817
3 votes
Accepted

SharePoint Online Webhook with ngrok "Access Denied"

Most likely you should add more permissions for your Azure AD app, AllSites.Manage or even AllSites.FullControl. Read\Write is more about the list items and not webhooks.
Sergei Sergeev's user avatar
2 votes
Accepted

SP07 - Open a pdf file in new tab on IE

Why you are using SPLinkButton? You can simply use HyperLink with its attribute called Navigateurl from your code. You can follow below steps in below mentioned URL. Open PDF files from a ...
Hardik's user avatar
  • 7,733
2 votes

My dropdown won't work after I exported the gridview to excel file?

It is SharePoint which displays your value as a DropDown/Select. The Field value in the SQL database is stored as a String (with only the selected value). When you export to Excel it exports values, ...
Danny '365CSI' Engelman's user avatar
2 votes
Accepted

How to query with 3 Conditions? CAML QUERY

queryMuaj.Query = "<OrderBy>" + "<FieldRef Name ='testb' Ascending = 'TRUE'/>" + "</OrderBy>" + "<Where>" + ...
Gaurravs's user avatar
  • 3,556
2 votes

How to design my site page in sharepoint, only want to use .net

You have two options to do that Create a blank custom master page and attach it to your page. Or just remove DynamicMasterPageFile="~masterurl/default.master" %> from <%@Page tag%> ...
Mohamed El-Qassas MVP's user avatar
2 votes

get Dropdown selected value SharePoint 2013

Make sure you write dropdown change event. Keep autopostback property to true. In dropdown change event of your dropdown write below code. protected void DropDownList4_SelectedIndexChanged(object ...
Gaurravs's user avatar
  • 3,556
2 votes

How to perform search on SharePoint list bound to a gridview

Place a search box and button on button click query your datasource i believe its List in this case public void Search(string searchText) { ClientContext clientContext = new ClientContext(...
Akshay Randive's user avatar
2 votes
Accepted

sharepoint server 2013 error Session state disabled for asp.net

In SharePoint 2013, try to do the following: Open the SharePoint web application web.config. In the <system.web> section, find the <httpModules> element and edit it like the following: &...
Mohamed El-Qassas MVP's user avatar
2 votes
Accepted

How to dynamically display most visited links in a SharePoint Site to site visitors?

If you are using SharePoint 2010, you can use a Web Analytics web part to display most visited pages in Site on the page. How to display most visited sites in SharePoint 2010 using Web Analytics web ...
JoannaW_MSFT's user avatar
  • 6,621
1 vote

Error "Attempted to use an object that has ceased to exist" while trying to access sharepoint landing page

The error message “Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))” occurs you're accessing an object that has been already disposed in ...
TARUN's user avatar
  • 2,856
1 vote
Accepted

SP Provider Hosted Add-in: HTTP Request is unauthorized while calling ItemAdded RER

I had discussion with experts and they did talked with MS team. The authenticated RER have issues and they failed to get invoked. Also, Azure Web app does not support 'Anonymous' access to particular ...
Vikram Shityalkar's user avatar
1 vote
Accepted

SharePoint Website Dev

I've been in the same boat as you for a little over two months: Commissioned to make a full website on SharePoint. For the longest time, I tried to work within SharePoint by developing SharePoint add-...
ICW's user avatar
  • 434
1 vote

The URL <filename> is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web

Loading the file works with a non-existing file as well. Try checking if the file exists with file.Exists before performing any other action. See: https://msdn.microsoft.com/en-us/library/microsoft....
Nsevens's user avatar
  • 468
1 vote

asp.Net MVC web application to be deployed on SharePoint

Here is some valuable info I found on the following blog However, I still feel that I need a little more research and concrete answers to my asked and unasked questions. Some of the unasked queries ...
raring sunny's user avatar
1 vote

Add permission on Workflow Task

Non programmatical way. You can use 2010 workflow with impersonation step where are permissions commands. Tick off Require Manage List permissions and set it to start when item is created.
Master SharePoint Slave's user avatar
1 vote

Flatten a managed metadata hierarchy for an MVC dropdown list using CSOM

If you can change the design to make Offices as a TermSet instead of Term , you can use TermSet.GetAllTerms which will give all terms inside a termset in flat hierarchy. Or you could add an extra ...
Unnie's user avatar
  • 8,819
1 vote

Running an MVC application on Sharepoint site or Convert to an Add-in

Hosting a .Net web application inside SharePoint farm or converting it to an Add-in is not a right solution to achieve Single Sign On capability. The right solution is to make both SharePoint and .Net ...
Unnie's user avatar
  • 8,819
1 vote
Accepted

How to create an asp.net form to retrieve list item to a gridview? Sharepoint 2013

The best practice to do that is to develop visual web part then host it inside SharePoint Site web part page . The visual web part will work like ASP.page inside SharePoint . To Create Visual Web ...
Mohamed El-Qassas MVP's user avatar
1 vote

Is it possible to invoke SharePoint 2013 APIs without creating a "SharePoint Add-In"

Since it is your custom WCF service. Couple of options In case of on premise deploy the WCF service into SharePoint Context (ISAPI) In case of office 365 you can create SAML request for ...
Amal Hashim's user avatar
  • 28.3k
1 vote
Accepted

How to retrieve visual web part properties programmatically? SharePoint 2013

To get the properties of a visual WebPart programmatically, you can refer to the following code for the WebPart at this article. public enum CityEnum { Manila, Berlin, Auckland, Zurich }; public ...
DebugCode's user avatar
1 vote

How to query with 3 Conditions? CAML QUERY

Try this query: <OrderBy> <FieldRef Name ='testb' Ascending = 'TRUE'/> </OrderBy> <Where> <And> <Eq><FieldRef Name='Team' /><Value Type='Text'&...
Dikesh Gandhi's user avatar
1 vote
Accepted

SP - How to change ID in URL and Redirect with Button Event

Updated Just try below code: Just replace SPUtility line with below code: string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path) + "?ID=" + wayBillID; SPUtility....
Dikesh Gandhi's user avatar
1 vote

SP - How to change ID in URL and Redirect with Button Event

Please try below mentioned code by which you can change the querystring parameter value UPDATED var qs = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.PathAndQuery); qs.Set("ID", "...
Hardik's user avatar
  • 7,733

Only top scored, non community-wiki answers of a minimum length are eligible