Hi there
I have a radTreeView for which I save the expansion status before postback, using the dynamically generated 'expandedNodes' cookie, as is standard. However, I want to be able replace the cookie with one I have created in my server-side PreRender handler for the radTreeView control.
I can rewrite the value of the cookie OK, the problem is when I do so, and add the new cookie using the same name, the old cookie is not replaced, and I end up with two 'expandedNodes' cookies, which evidentally confuses the radTreeView, which ignores both the cookies. I want to replace the old cookie originally generated by the control, to use the server-side version generated by my code, which as far as I am aware uses the correct technique as follows:
Dim cookie As HttpCookie = New HttpCookie("expandedNodes")
cookie.Value = newcookievalue // Setup earlier by constructing '*' delimited expansion route
cookie.Expires = DateTime.Now.AddDays(1)
Response.Cookies.Add(cookie)
after which, at the end of the PreRender handler, the Response.Cookies collection only has 1 expandedNodes cookie, the one I have just added here. But then after the postback is complete, this cookie is ADDED rather than REPLACING the existing cookie of the same name.
How can I get the radTreeView to use the new cookie, instead of the old one? That is, how can I delete the old cookie, which currently seems to be restored by the radTreeView, in addition to the cookie my code is adding. Is this a problem involving some combination of the ExpandMode property or the Viewstate?
What would be the best approach to this issue?
Regards
I have a radTreeView for which I save the expansion status before postback, using the dynamically generated 'expandedNodes' cookie, as is standard. However, I want to be able replace the cookie with one I have created in my server-side PreRender handler for the radTreeView control.
I can rewrite the value of the cookie OK, the problem is when I do so, and add the new cookie using the same name, the old cookie is not replaced, and I end up with two 'expandedNodes' cookies, which evidentally confuses the radTreeView, which ignores both the cookies. I want to replace the old cookie originally generated by the control, to use the server-side version generated by my code, which as far as I am aware uses the correct technique as follows:
Dim cookie As HttpCookie = New HttpCookie("expandedNodes")
cookie.Value = newcookievalue // Setup earlier by constructing '*' delimited expansion route
cookie.Expires = DateTime.Now.AddDays(1)
Response.Cookies.Add(cookie)
after which, at the end of the PreRender handler, the Response.Cookies collection only has 1 expandedNodes cookie, the one I have just added here. But then after the postback is complete, this cookie is ADDED rather than REPLACING the existing cookie of the same name.
How can I get the radTreeView to use the new cookie, instead of the old one? That is, how can I delete the old cookie, which currently seems to be restored by the radTreeView, in addition to the cookie my code is adding. Is this a problem involving some combination of the ExpandMode property or the Viewstate?
What would be the best approach to this issue?
Regards