Questions tagged [codebehind]

Code-behind refers to code for your ASP.NET page that is contained within a separate class file.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

“system cannot find the file specified” error when clicking on code Editor in InfoPath form

I am migrating InfoPath 2007 to 2010.There were issues in connecting the form to the code. So I removed the code and added the code again and built the form. But if I close the form looks like, the ...
1
vote
0answers
48 views

Async call to REST API in page layout code-behind

Please excuse my ignorance -- I am not sure if this is even correct practice, let alone possible to achieve in SharePoint. My self-taught knowledge of SharePoint development was all learned by ...
1
vote
1answer
38 views

Sharepoint - place a Ribbon button that downloads current selected documents to a folder

So, I'm fairly new to Sharepoint development. I have done a couple of webparts in the past and that about sums up my experience with sharepoint development. I'm seeking your guidance on what's the ...
1
vote
2answers
123 views

include aspx file

I want to include one aspx file into another: I am creating pages with menu and I want to use menu.aspx in few aspx pages. I found that there is a function <!--#include virtual="somefilename"-->...
0
votes
1answer
74 views

Change Code Behind code in existing sharepoint farm solution

I am new to Sharepoint. I am using Sharepoint designer 2013. There is an existing ASP.NET application hosted in IIS. I am able to find Login.aspx in C:\Program Files\Common Files\Microsoft Shared\Web ...
1
vote
2answers
259 views

Removing accounts from PeopleEditor not working

I have a PeopleEditor in my ASPX page: <SharePoint:PeopleEditor ID="ccAuthor" runat="server" SelectionSet="User" MaximumEntities="1" /> And access its contents when the corresponding save ...
1
vote
2answers
556 views

Escaping Special Characters in SharePoint Search Query

I am trying to create a free text search in SharePoint 2010 using code behind. The code to create my query is shown below: StringBuilder query = new StringBuilder(); query.Append("SELECT FileLeafRef, ...
0
votes
2answers
41 views

SharePoint solution - link access code-behind C# method [closed]

I have a SharePoint solution with a link and a C# method. There is any way I can access the C# method from the a tag: <a href="#" runat="server" onclick="MyFunction()">CLICK</a> public ...
1
vote
2answers
177 views

Modal Dialog read params server side

I have an applicationPage who is open by Modal Dialog. I would like to read this params server side in the application page . I don't use the URL for passing parameter, i use the options.args Is it ...
0
votes
1answer
462 views

How to add column with Link to item with edit menu in view from code behind?

I am creating a view from code behind. The view contains Title column for which I would like to be a link to open the list item and have a drop-down menu. I know that this is done by setting <...
3
votes
1answer
2k views

Why am i unable to debug an Provider Hosted SharePoint app?

I have a method which checks valid session which gets triggered in page load,I have placed break points in it for debugging purpose.When I run my provider hosted sharepoint app it does not hit the ...
1
vote
2answers
652 views

Saving file from SharePoint Server to shared folder - Which user account?

We are trying to save a file temporarily from the SharePoint 2010 Server to a shared folder in the network from a custom application page. This part is done in the code behind file of the application ...
1
vote
1answer
335 views

Create application page on O365

I have created an aspx page for login to O365. I then found a post saying you cannot have .cs code behind files on SharePoint that you should reference an assembly. I am assuming the assembly in ...
0
votes
1answer
71 views

Why can I not call a public method in my Web Part (User Control) from an Event Receiver?

I've added this Event Receiver (based on what I found here): using System; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePoint.Security; using Microsoft....
0
votes
1answer
45 views

Is there a way to tell from the (C#) code-behind when I insert into a Sharepoint List from JavaScript?

I want to respond to the insertion of data into a Sharepoint list (which will be done from the client/JavaScript (*.asxc file) in the code-behind/C#. Is there a way to do that? Can I hook up an "...
0
votes
0answers
83 views

Why does marking an html element of type date “run at server” fail in Sharepoint 2010?

I thought HTML5 was backwards compatible - so why does Sharepoint 2010 knock me sprawling to the ground when I try to use the new input type "date"? That's apparently the problem here; my Web Part ...
0
votes
1answer
925 views

Modal dialog window UI won't load before code behind

I have become onto a problem, where my Modual dialog window won't load it's UI before the code behind executes. But once the code behind executes, then the UI won't load until code has executed and ...
0
votes
2answers
259 views

Sharepoint 2013 flowchart workflow custom code

I'am SharePoint 2013 beginner and i have a project where i need to create a workflow (With Visual Studio), so i started my workflow as flowchart workflow then at some point i needed to write custom ...
0
votes
0answers
80 views

List field manipulation based on rules

he following situation: I have got list (List A) with the following fields. Field A ->String Field B-> String Field C →LookUp to another list Field D → Calculated field Field E On creating or ...
0
votes
1answer
412 views

How can I capture a button click event on a dynamically created button?

I am trying to use the method described here to emulate an application page in a sandbox solution. The basic premise is to create a web part, and deploy a web part page that has that web part already ...
0
votes
1answer
471 views

SharePoint sandboxed solution call javascript function from back end

I have created a sandboxed solution for SharePoint 2013 which contains sandboxed visual webpart. I need to call JavaScript function from back end. How can I accomplish this requirement? How can we ...
0
votes
1answer
2k views

Error : Type is not registered as safe

I am creating a code behind file for the site page of sharepoint. The following page directive was used <%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, ...
0
votes
2answers
67 views

Not able to pop up alert box on page load

I have created a code behind file for a site page. The .cs file looks as follows : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; ...
0
votes
1answer
234 views

code behind file for aspx in sharepoint

I am trying to add code behind file for .aspx file of sharepoint site pages. I followed the instructions given on this link Here But I am getting this error Could not load the assembly 'CustomPage,...
1
vote
2answers
176 views

How to trigger an event before a page loads?

In my sharepoint site I want to check whether a user is in sharepoint group or not and then only allow it to go to the home page. This should happen when a user goes to my sharepoint site for the ...
0
votes
1answer
602 views

Throwing error on adding a @Page directive

I wanted to have a code behind file for home.aspx file for my sharepoint site. but on adding this <%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="...
2
votes
1answer
1k views

How to add code behind file for home.aspx?

I want to add a code behind file to check the user's group. But I cannot find the code behind file for home.aspx. How can I create one?
0
votes
1answer
229 views

Code behind for NewForm.aspx (Announcement List)

I have designed a Form for Announcement list, I want to write a code on the Save button, which could save a file attached (browse/fileupload button) by user in the form (check screenshot). I want to ...
3
votes
1answer
295 views

How can I get a listitem/page related resources from code behind

In the GUI it is possible to get the resources used by a page as shown by the image. Now I would like to get this information in the code behind so that I can modify only pages that are using a ...
3
votes
2answers
1k views

how to redirect to “page not found”

how to redirect to "page not found" for code in SharePoint 2013? To page /page/PageNotFoundError.aspx Does anyone knows how can I do that? example: item.status = rejected then this.page.redirect = ...
1
vote
1answer
727 views

how to I can set friendly url for a list item?

how to I can set friendly url for a list item? I need set the Friendly Url in an item of a determined list Example: http://[Sitio]/[List]/[ListName]/DispForm.aspx?ID=1 to http://[sitio]/[Pagina]/[...
0
votes
2answers
599 views

Close SPDialog after using Response.TransmitFile

I am using some javascript to open a dialog like this: var options = { title: "Generate Report", url: "/_layouts/ConfirmPrint.aspx", dialogReturnValueCallback : Function.createDelegate(...
0
votes
1answer
811 views

Associate code behind with a master page in SharePoint 2013

I want to associate some code behind with my master page by using the html/master conversion. I added something like this just after LocalBinding in my html file: <!--SPM:<%@ Master language="...
0
votes
2answers
364 views

Is it possible to fire a JavaScript function on a SharePoint Control in Application pages?

I am working on SharePoint Application pages. I have a SharePoint DropDownChoiceField control on the aspx page. The requirement is to auto populate this control at the time of page load. Is there a ...
0
votes
1answer
266 views

ListView creation on server, retain sorting, paging, search - which control to use?

I want to create a list view from code behind so that I can control it's item collection through CAML easily (plus several conditions that would be much too hard to do in javascript). I tried using ...