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

Forums / Developing with Sitefinity / After Edit redirect to main page

After Edit redirect to main page

22 posts, 0 answered
  1. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Jan 2010
    Link to this post
    hi i m editing a news letter module. when clicking the edit button in the grid it is redirecting to a edit user control and after editing i m unable to back to the grid page.
    please help me.It's urgent

    Thanks
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Jan 2010
    Link to this post
    Hi asit pani,

    Thank you for using our services.

    This is not the default behavior. Then you edit a subscriber you are redirected back to the page listing all subscribers for selected group. Do you have custom code? If yes could you please share it with us. Otherwise there should be no problems with this.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Jan 2010
    Link to this post
    hi thanks for ur reply.

    yes i have created a new save button and added some custom logic there .now i want to back to the listing page .
    i have the subscriber id and group id with me but how can i back to the listing page. for that i have no code yet .

    thanks
  4. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Jan 2010
    Link to this post
    hi please help me it's urgent.


    Thanks
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Jan 2010
    Link to this post
    Hello asit pani,

    Try this one:
    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    18 Jan 2010
    Link to this post
    Hi thanks for ur reply.
    This problem has solved. But how to refresh the gridview after update the user.
    i have used GridView1.DataBind();
    but the grid is not refreshing always. I can't know what's the problem .
  7. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    18 Jan 2010
    Link to this post
    hi i need it urgent .
    Thanks
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Jan 2010
    Link to this post
    Hello asit pani,

    I do not know what kind of logic you have in your event handler for the button which you have added. I have added this to a custom control in my side and it always rebinds the grid since the data source is changed:
    Telerik.Notifications.Newsletters.WebControl.SubscriberEditor subsciberEditor = (Telerik.Notifications.Newsletters.WebControl.SubscriberEditor)this.Parent.Parent;
    if (subsciberEditor != null)
    {
        Telerik.Notifications.Newsletters.DataManager newslettersManager = new Telerik.Notifications.Newsletters.DataManager();
        Telerik.Newsletters.ISubscriber subsciber = newslettersManager.GetSubscriber(this.emailtxt.Text);
        subsciber.FirstName = this.firstNametxt.Text;
        newslettersManager.SaveSubscriber(subsciber);
        ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;
    }

    Do you call the SaveSubsciber method of the newsletter manager class? As for the DataBind of the grid, please check in which event you call this method.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    19 Jan 2010
    Link to this post
    Hi Radoslav,

    Thanks for ur reply.
    I m already redirect to the list page after updating, but can't refresh the gridview.

    I have already used this code.
    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;

    But I m not using the sitefinity dataManager. I m using my custom data manager.
    then after the page redirect to the subscriber group page, how can be the grid refreshed.

    It's urgent plz.
  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Jan 2010
    Link to this post
    Hello asit pani,

    Try rebinding the grid before you change the display mode:
    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).Refresh();    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;

    The refresh method re-creates the child controls of the control panel, which should refresh the grid also (that is if you have persisted all changes to the subscribers).

    All the best,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    19 Jan 2010
    Link to this post
    Hi
    Thanks for ur reply. But itis showing error.

    Server Error in '/' Application.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 98:         {
    Line 99: ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).Refresh();
    Line 100: ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;
    Line 101: //((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).
    Line 102: Session["update"] = "True";

    Source File: c:\Projects\Live\Sitefinity\Admin\ControlTemplates\Notifications\SubscribersEditorTemplate.ascx.cs    Line: 100

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    Sitefinity_Admin_ControlTemplates_Notifications_SubscribersEditorTemplate.lnkbtnsave_Click(Object sender, EventArgs e) in c:\Projects\QFC_Live\Sitefinity\Admin\ControlTemplates\Notifications\SubscribersEditorTemplate.ascx.cs:100
    System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
    System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Jan 2010
    Link to this post
    Hi asit pani,

    I saw that you are adding some properties to the session. In SubscribersEditorTemplate.ascx.cs where you have the event handler for your button try this:
    Session.Add("updated", true);
    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup;

    and then in Page_Load of the SubscribersTemplate.ascx try this:
    protected void Page_Load()
    {
        if (Session["updated"] != null)
        {
            if ((bool)Session["updated"] == true)
            {
                Session.Remove("updated");
                //try this
                GridView1.DataBind();
            }
        }
    }

    All the best,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    19 Jan 2010
    Link to this post
    Hi
     i already tried this but same problem occurs.

    Thanks.
  14. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    19 Jan 2010
    Link to this post
    plz help me it's urgent.

    I tried using this.
    ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).Refresh();     


    But after some time it gave me the error.

    Thanks
  15. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    19 Jan 2010
    Link to this post
    hi please guide me.......i need it.
  16. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Jan 2010
    Link to this post
    Hi asit pani,

    The sample from my last post worked. You have to rebind the grid after you change the display mode. What kind of error you get when you try out what I last posted?

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  17. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    20 Jan 2010
    Link to this post
    Hi Radoslav

    I tried this but it is not refreshing the grid always. sometimes it is not refreshing.

    In SubscribersEditorTemplate.ascx.cs

     Session.Add("updated","yes");
       ((Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel)this.Parent.Parent.Parent).DisplayMode = Telerik.Notifications.Newsletters.WebControl.Admin.ControlPanel.Display.SubscriberOfGroup; 
     

    In Page_Load of the SubscribersTemplate.ascx

    if (Session["updated"] != null
            { 
                if (Session["updated"] == "yes"
                { 
                    Session.Remove("updated"); 
                    
                    GridView1.DataBind(); 
                    messageCtrl.Message = "1 subscribers has been Updated successfully."
                    messageCtrl.Mode = Telerik.Cms.Web.UI.MessageMode.Success; 
                } 
            } 

  18. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    20 Jan 2010
    Link to this post
    hi

    it's urgent please help me.
  19. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    21 Jan 2010
    Link to this post
    Hi Radoslav

    Please reply me. I can't find any solution for it.

    Thanks.
  20. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jan 2010
    Link to this post
    Hello asit pani,

    Please tale a look at the following articles

    Modifying Data in a GridView Web Server Control
    BaseDataBoundControl.DataBound Event
    GridView Web Server Control Events
    GridView.RowDataBound Event
    GridView.RowUpdating Event
    GridView.RowUpdated Event

    Make sure that your ViewState is not disabled. Calling GridView1.DataBind(); should do the trick. Try do it inside OnPreRender. You can use this event to perform any last minute operations on your controls. You could also try to pass the session as suggested before.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  21. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    21 Jan 2010
    Link to this post
    Hi i tried this but no result. Grid is not refreshing.

    I tried like this
    protected void Page_PreRender(object sender, EventArgs e) 
        { 
            GridView1.DataBind(); 
        } 


    Actually the event is fired  and it's going inside the code. I tested it dispalying some message and it is displayed. But the databind() method is not working.

  22. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    22 Jan 2010
    Link to this post
    Hi Ivan

    please give me a solution.

    Thanks
Register for webinar
22 posts, 0 answered