DNN Page state persistence + Toolbarbutton postback

4 posts, 0 answers
  1. Zyguy
    Zyguy avatar
    23 posts
    Member since:
    Jan 2008

    Posted 10 Nov 2009 Link to this post

    We have a Q1 2009 RadToolbar, with a Radcombobox load-on-demand autosuggest search input in one template button. In the next, we have a RadToolBarbutton acting as the Submit search button.  This setup has worked fine for a long time, however recently switching our Dotnetnuke page state persistence to 'Memory' from 'Page' results in the unusual behaviour that clicking the search submit button, does not seem to fire the server-side button click event, it just does a postback and nothing happens.

    Strangely,the exact same code works on a child dotnetnuke portal, just not on the parent portal. We would really like to use Memory state persistence as it delivers much better clientside performance, and so far this button not posting back seems to be the only hang-up. 

    Can someone please say why this button event would no longer fire, based on in-page viewstate vs memory/session viewstate? It is Dotnetnuke 4.9.1.

    .ascx:
    <%@ Control language="vb" Inherits="MySite.Modules.Search.ViewSearch" CodeFile="ViewSearch.ascx.vb" AutoEventWireup="false" %><%@ Register TagPrefix="dnn" TagName="SCBreadcrumb" Src="~/DesktopModules/SCBreadcrumb/SCBreadcrumb.ascx" %><script type="text/javascript">function OnASClientItemsRequestFailedHandler(sender, eventArgs){eventArgs.set_cancel(true);}var myTimer=null;var isTimerRunning=false;function KeyPressHandler(comboBox,eventArgs){if(isTimerRunning){stopTimer();}myTimer=setTimeout('requestItems()',500);isTimerRunning=true;}function RequestingHandler(sender, eventArgs){if (sender.get_text().length < 3){eventArgs.set_cancel(true);}}function stopTimer(){if(isTimerRunning){clearTimeout(myTimer);timerRunning=false;}};function RadComboKeyPress(sender, eventArgs) {var keyCode = eventArgs.get_domEvent().keyCode;if (keyCode == 13) {var toolbar1 = $find("<%= RadToolBarSearch.ClientID %>");var templateButton = toolbar1.findItemByValue("MainSearch");templateButton.click();}}</script><table width="100%"><tr><td align="left"><telerik:RadToolBar runat="server" ID="RadToolBarSearch" Skin="Telerik" EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" OnButtonClick="RadToolBarSearch_ButtonClick" EnableLoadOnDemand="False" EnableViewstate="False" style="width:100%;display: block; float: none;min-width:500px;"><Items><telerik:RadToolBarButton id="SearchTemplate" Value="TemplateTextBox" Text="BasicSearch"><ItemTemplate><telerik:RadComboBox Skin="Hay" id="RadComboBoxAS" Runat="server" Width="215px"  EnableItemCaching="True" AllowCustomText="true" MarkFirstMatch="false"  EnableLoadOnDemand="true" EmptyMessage="Enter keyword(s)"  OnClientKeyPressing="RadComboKeyPress" OnClientItemsRequestFailed="OnASClientItemsRequestFailedHandler" OnItemsRequested="RadComboBoxAS_ItemsRequested" HighlightTemplatedItems="true" DataTextField="strKeyword" EnableViewstate="False" LoadingMessage = "<img src=/images/loading1.gif height=7px width=51px>" AnimationType="None" ShowToggleImage="False" EnableTextSelection="True"></telerik:RadComboBox></ItemTemplate></telerik:RadToolBarButton><telerik:RadToolBarButton id="SearchSubmitTemplate" text="SEARCH" Group="Search" AllowSelfUncheck="true" value="MainSearch" ImageURL="http://css.zymmetrical.com/search-stock-photos.png" ImagePosition = "1" checked="True" cssclass="CustomItem"></telerik:RadToolBarButton><telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton><telerik:RadToolBarButton id="BCTemplate"><itemtemplate>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dnn:SCBreadcrumb runat="server" CSSClass="copyright" id="dnnBreadcrumb" Separator="&nbsp;&raquo;&nbsp;" RootLevel="0" LastAsSpan="False" /></itemtemplate></telerik:radtoolbarbutton></items></telerik:RadToolBar> 

    button fire event:
    Public Sub RadToolBarSearch_ButtonClick(ByVal sender As ObjectByVal e As RadToolBarEventArgs) 
    If  e.Item.Value = "MainSearch" THEN 
    Dim keywords As String 
    If len(keywords)< 1 THEN 
        Response.Write("<script>alert('Please type some keywords in the box and then click Search button');</script>")   
        Else         
    Response.Redirect (lcase("/search-results/keyword/" + keywords + "/")) 
    End if 
    End Sub   

  2. Zyguy
    Zyguy avatar
    23 posts
    Member since:
    Jan 2008

    Posted 15 Nov 2009 Link to this post

    Bump. :)      Surely this isn't so complex a question as it sounds - what is the relationship between viewstate and Radtoolbarbuttons?

    Another anomaly we have noticed with moving viewstate into SQL storage or Memory, is that with a Needdatasource Radgrid. clicking the next/previous arrows on the default pager, only work to advance one page. Once you click and it advances the pageset, subsequent clicks on the arrow imagebuttons do not have any effect. Clicking on the numeric text number links for paging work as expected.

    Thanks in advance for any pointers.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 18 Nov 2009 Link to this post

    Hello Zyguy,

    It is possible that DNN's 'Memory' state persistence is not properly implemented and is causing problems. I also noticed this bug report and it seems to be fixed in DNN 5.1.0

    All the best,
    Dimitar Milushev
    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.
  5. Zyguy
    Zyguy avatar
    23 posts
    Member since:
    Jan 2008

    Posted 18 Nov 2009 Link to this post

    Thanks, I was aware of some kind of issues revolving the Memory Page Persistence in older versions of DNN. Lot's of people saying 'don't use that!' - however it seems to be a bigger issue than just Memory persistence - we also tried a couple SQL viewstate providers and had the same strange results - a Radtoolbarbutton click event would not seem to fire, or the Radgrid pager imagebuttons would break down after one page change postback.

    For now we have gone back to standard in-page Viewstate, slower for the clients but works at least.
Back to Top