This is a migrated thread and some comments may be shown as answers.

When Response.Redirect the page, TreeView will be frozen.

15 Answers 200 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Leo
Top achievements
Rank 1
Leo asked on 17 Oct 2011, 11:04 AM
In my project, for localization, I need to Rresponse.Redirect the page itself.
Once redirect the page, it will read one given XML file and generate TreeNode dynamicly through the querystring "locale".
But after redirect several times, the whole TreeView cannot be operated no longer although its nodes have displayed in browser.
This problem will occur in IE and Chrome. Firefox and Opera are good.

15 Answers, 1 is accepted

Sort by
0
Leo
Top achievements
Rank 1
answered on 19 Oct 2011, 07:25 AM
Can anyone help me? :(
0
Plamen
Telerik team
answered on 20 Oct 2011, 10:30 AM
Hi Leo,

I have tested the issue by adding this code to the Populating from XML demo:
<telerik:RadButton runat="server" ID="RadButton1" Text="Response" OnClick="RadButton1_Click">
   </telerik:RadButton>

protected void RadButton1_Click(object sender, EventArgs e)
       {
           Response.Redirect("DefaultCS.aspx", true);
       }

But after several clickings I could not observe any unusual behaviour.

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Kevin
Top achievements
Rank 2
answered on 21 Oct 2011, 01:30 PM
Hello Leo,

Are you using Ajax for the buttons that change the locale? If so, you should be using the RadAjaxManager.Redirect() method instead.
0
Leo
Top achievements
Rank 1
answered on 27 Oct 2011, 07:02 AM
Thanks Plamen,

For the problem I mentioned, perhaps I've found the reason. I misused RadAjaxPanel.
But I have met with another problem:
In my project, localization is an important functionality. But when I switch to Japanese language, the RadTreeView and RadCombobox still will be frozen. User cannot select TreeNode and cannot drop down the list of RadCombobox.
For other language even Chinese, the page works well. Only page with Japanese characters will occur the strange thing.

Thanks,
Leo
0
Leo
Top achievements
Rank 1
answered on 27 Oct 2011, 07:04 AM
Hi Kevin,

It is not the reason. But thank you anyway. :)

Thanks,
Leo
0
Leo
Top achievements
Rank 1
answered on 27 Oct 2011, 07:46 AM
Hi Plamen,

I've solved the problem for Japanese chars. It's IE's problem and I've found one alternative. :-)

But, hmm......

After I use RadAjaxManager instead of RadAjaxPanel, the frozen page still occurs, but it is not often.
Because I use many .Net controls and Telerik controls at the same time. I don't know if their cooperation has some problems.

Sometime I will add asp:panel out of one RadCombobox and do something like this.

Thanks,
Leo
0
Plamen
Telerik team
answered on 27 Oct 2011, 02:57 PM
Hi Leo,

Can you clarify which exactly RadControls and asp controls are you using at the same time to observe this "freezing"?

Meanwhile here is a help topic that may be helpful.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Leo
Top achievements
Rank 1
answered on 31 Oct 2011, 12:11 PM

Hi Plamen,

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rtvNav">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pContent">
                </telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<div>
    <telerik:RadTreeView ID="rtvNav" 
runat="server">
        ......
        OnNodeClick="..."
        ...
    </telerik:RadTreeView>
</div>

...

<asp:Panel 
ID="pContent">
    <div>
        
<div>
            
<p id="pHead" 
runat="Server">
                ...
            </p>
        
</div>
    
</div>
</asp:Panel>

My telerikcontrol will be frozen when the page "Response.Redirect" itself.
Another question, in this sample, I want to let RadTreeView control one panel. Have I set <asp:Panel> as the panel? Any other telerik control can be used for just one panel?


Thanks,
Leo
0
Leo
Top achievements
Rank 1
answered on 03 Nov 2011, 10:38 AM
Hi Plamen,

Have you seen my codes? For convenience, I simplified the sample, but the structure did not change so much.
I find that if network enviroment is worse, the problem will occur more often.
You can test it in one bad network enviroment.

Thanks,
Leo
0
Plamen
Telerik team
answered on 03 Nov 2011, 11:32 AM
Hi Leo,

I am sending you the project that I tested, but could not obsreve anything unusual. Would you please review the code and let me know what to change in order to observe the issue. 

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Leo
Top achievements
Rank 1
answered on 03 Nov 2011, 12:02 PM
Thank you and I'll check it  :-)
0
Leo
Top achievements
Rank 1
answered on 07 Nov 2011, 04:26 AM
Hi Plamen,

I modified some codes and these codes will result the problem:
You could click "Redirect" button frequently and quickly. After clicking several times, all nodes can not be clickable and all node tree text will be just like one image on the page.

Environment: IIS6, Windows2003, Visual Studio 2008, IE9

TelerikWebForm.aspx:

 

......
    <
form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rtvNavigation">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pContent"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
                    
        <div style="float:left;">
            <telerik:RadTreeView ID="rtvNavigation" runat="server"
                onnodeclick="rtvNav_NodeClick"
                OnClientNodeClicked="onNodeClick"
                OnClientDoubleClick="onNodeDoubleClick"
                Skin="Windows7"
                CollapseAnimation-Duration="500"
                ExpandAnimation-Duration="500">
            </telerik:RadTreeView>
        </div>
        <div style="float:left;">
            <asp:Panel ID="pContent" runat="server">
                <div>
                    <div>
                        <p id="pText" runat="Server">
                            Text
                        </p>
                    </div>
                </div>
            </asp:Panel>
            <asp:Button runat="Server" ID="btnRedirect" Text="Redirect" onclick="btnRedirect_Click" />
        </div>
        <div style="clear:both;">
        </div>
    </form>
      
      
      
    <telerik:RadCodeBlock runat="Server" ID="RadCodeBlock1">
        <script type="text/javascript">
            //nav node click
            function onNodeClick(sender, args) {
                args.get_node().expand();
            }
          
            //nav node double click: do nothing
            function onNodeDoubleClick(sender, args) {
                args.set_cancel(true);
            }
  
        </script>
    </telerik:RadCodeBlock>

......

TelerikWebForm.aspx.cs:

 

......
protected
void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        LoadNav();
    }
}
private void LoadNav()
{
    RadTreeNode rtnRoot = new RadTreeNode();
    rtnRoot.Text = "Root";
    rtnRoot.Font.Bold = true;
    rtnRoot.ForeColor = Color.DarkSlateBlue;
    rtnRoot.Expanded = true;
    rtvNavigation.Nodes.Add(rtnRoot);
    for (int i = 0; i < 100; i ++)
    {
        RadTreeNode rtnChild = new RadTreeNode();
        rtnChild.Text = "Child " + i;
        rtnChild.ForeColor = Color.DarkSlateBlue;
        rtnRoot.Nodes.Add(rtnChild);
    }
}
protected void rtvNav_NodeClick(object sender, RadTreeNodeEventArgs e)
{
    pText.InnerHtml = e.Node.Text;
}
protected void btnRedirect_Click(object sender, EventArgs e)
{
    Response.Redirect("TelerikWebForm.aspx", true);
}
......
0
Plamen
Telerik team
answered on 07 Nov 2011, 05:51 PM
Hi Leo,

I examined the code and actually the onClientDoubleClick event of RadTreeView  can not be canceled. Probably the javascript error was thrown because of this.

Everything else works as expected at my side.

Best wishes,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Leo
Top achievements
Rank 1
answered on 08 Nov 2011, 02:21 AM
Hi Plamen,

Thanks for the comments.
Actually if I remove the OnClientDoubleClient event, the problem still exists.

You can hover to node to detect if the node's style is valid every time you "Redirect" the page.
Probably you have to operate it quickly.

Today I find the if RadTreeView (and RadCombobox) has at last one client event, the problem will occur.
I know the problem is strange and hard to be reproduced. :-)

Thanks,
Leo
0
Plamen
Telerik team
answered on 10 Nov 2011, 05:51 PM
Hi Leo,

I tested the project with your code again but still could not notice anything unusual.Here is the video:
http://screencast.com/t/Wufz2CeeH2YU

Would you please let me know what should I do to observe the issue or just send a video link as well.


Kind regards, Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Leo
Top achievements
Rank 1
Answers by
Leo
Top achievements
Rank 1
Plamen
Telerik team
Kevin
Top achievements
Rank 2
Share this question
or