0

I have a SharePoint 2013 list and in the DisplayForm.aspx.cs, I have written a function saveastemplate(). Now, I want to reuse the same function in an application page.

Is it possible at all, if so, how can I reuse the function in a custom application page?

Thank you.

2
  • What you mean by My application pages? Are you referring to settings.aspx or viewlsts.aspx and so on.. or your customized pages?? Commented Jan 4, 2018 at 13:39
  • i have ribbon button (customaction) and this open a custom application page. In this application page i want to reuse the function. Commented Jan 4, 2018 at 14:00

1 Answer 1

0

Since you are using a custom application page(as you mentioned in your comment) you can find it in 15 hive configured path. then you can read values from query string and do your operation in javascript function.


EDIT

If you want to reuse C# function.

  1. Develop a "Class Library" project.
  2. Add it in to GAC.
  3. Add safecontrol entry in web.config.
  4. Finally import/add the dll reference to your application pages.

References: MSDN article to create application page. & Here for detailed steps to create Class library.

4
  • Sorry i don't get it. could you give me an example code please Commented Jan 4, 2018 at 15:09
  • There are 2 thing you mentioned in your comment, 1. You have a common application page. 2. You have a javascript function. So in theory you need to open the application page and place you js function. refer for cool example..sharepoint.stackexchange.com/questions/28029/… Commented Jan 4, 2018 at 15:28
  • Sorry its not a javascript function but its a c# function. Commented Jan 4, 2018 at 15:42
  • Updated my answer.. Commented Jan 4, 2018 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.