1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Getting values during edited/insert mode in Generic Modules

Getting values during edited/insert mode in Generic Modules

5 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    23 Aug 2008
    Link to this post
    Hi,

    I need to save some values from News Module in one external database during creation (save, update, delete). I have created one Onclick event linked to save button but I'm not able to get the values from TextBoxes like "Author" to save-it in ControlpanelEdit/insert from News module.

    Someone have the solution to get a value from MasterPage (ControlPanelEdit/Insert) in codebehind? I have tested many methods including javascript but with no chance to get the values to save.

    Regards
  2. Adam @Habanero
    Adam @Habanero avatar
    45 posts
    Registered:
    22 Jun 2012
    26 Aug 2008
    Link to this post
    Hi Pierre

    If you find the template that you are using for the news viewer, in /sitefinity/ControlTemplates/News you can then add a code behind class to that file. 

    Once this is done, you can then use FindControl in the page load of you new code behind to find the save button, and attach some code to that button's click event.

    In the Click event handler, use find control to find the form controls and get the values you are looking for.

    See the example below for a sample of how to create a code behind for a template.  You won't use this same template, but you will use this method.

    How to notify approvers when a News item is sent for approval

    Hope this helps
    Adam
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    26 Aug 2008
    Link to this post

    Hi Adam,

    Thanks for the way Adam. I have the solution using this method and searching the control using one FindControl recursive method. Regards.

     

  4. Adam @Habanero
    Adam @Habanero avatar
    45 posts
    Registered:
    22 Jun 2012
    26 Aug 2008
    Link to this post
    No problem, glad I could help.
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Aug 2008
    Link to this post
    Hi Adam,

    Thank you for taking part of this discussion. We have updated your Telerik account for helpful reply in our forums!

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
5 posts, 0 answered