locked
asp.net Application_PreRequestHandlerExecute event handler and javascript RRS feed

  • Question

  • User-1434679669 posted

    hi,

         i am changing the theme of the page in based on the user selection in Application_PreRequestHandlerExecute event in global.asax file in asp.net 3.0 based on this event i am successfully changing the theme and colour of my page successfully but after the page is loading xmlHttpRequest and javascript code in the aspx file is not working i am using Ajaxcontrol toolkit for AjaxXmlHttpRequests can any body please help me to solve this issue.

    Thanks in advance.

    Tuesday, July 1, 2014 6:17 AM

Answers

  • User-417640953 posted

    Hi nallagonda,

    Thanks for your post.

    Based on your description, I understand you apply the page theme in the Application_PreRequestHandlerExecute like below.

    void Application_PreRequestHandlerExecute(object sender, EventArgs e)
            {
               
                Page page = HttpContext.Current.CurrentHandler as Page;
                if (page != null)
                {
                    page.Theme = "BlueTheme";
                }
    
            }

    If the ajax not work in the page, maybe the theme has an affect on your javascript code. You can share a living demo with us and let us reproduce

    your issue. Then we will give you further solutions. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 2, 2014 5:41 AM

All replies

  • User-1366948256 posted

    Are you hosting your javascript files and other stuff with theme then you need to change that javascript file with theme because if your javascript file is not found then it will create problem.

    Still if you have problem provide more information

    Tuesday, July 1, 2014 10:00 AM
  • User-417640953 posted

    Hi nallagonda,

    Thanks for your post.

    Based on your description, I understand you apply the page theme in the Application_PreRequestHandlerExecute like below.

    void Application_PreRequestHandlerExecute(object sender, EventArgs e)
            {
               
                Page page = HttpContext.Current.CurrentHandler as Page;
                if (page != null)
                {
                    page.Theme = "BlueTheme";
                }
    
            }

    If the ajax not work in the page, maybe the theme has an affect on your javascript code. You can share a living demo with us and let us reproduce

    your issue. Then we will give you further solutions. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 2, 2014 5:41 AM