EnableViewState and ViewStateMode not working - c#-4.0

I am working in C#.Net and Framework 4.0. I am having a aspx and ascx pages. In my ascx, i am generating a XML and binding that XML value to Treeview. These are done in code behind. i am calling this ascx in my aspx page.
My issue is, i am having large volume of XML Data. Because of this, the performance of the page is very slow. I tried with enableviewstate and viewstatemode. But nothing works for me.
Still the viewstate is holding large volume of XML Data. I dont want this XML Data to be in viewstate.
How to fix this.

Atlast, i had done with a temporary fix..Cleared the controls viewstate value in JQuery..This process had be done in submit button onclientclick.
$('#ctl00_ContentPlaceHolder1_TreeView').empty();
And, out side the postback in pageload, i had again generated the XML value

Related

Render Widget as HTML in Code Behind

I have come across a situation where I'm needing to retrieve the rich text content of a page type column, and return that data/HTML as it would appear on a rendered page. A custom web part then serves aggregated data as nodes of XML or JSON.
For the most part this was easy enough in the code behind using DocumentQuery, however the problem is with widgets that have been inserted into the content.
My question is: How do I "render" a widget purely in code? Or even, what process is Kentico doing to render a widget that I might be able to reproduce?
I am somewhat familiar with the widget/web part/user control relationship, so I'm thinking a web part would need to be instantiated (somewhere, somehow) using the properties on the widget, and then accessing the RenderedHTML property of the web part.
Due to the format that widgets are stored in the data, I was hoping that they could just be Resolved with the MacroResolver, but that doesn't seem to be the case.
For reference, here is an example of how the out-of-the-box DateTime widget shows up:
{^widget|(jsuseservertime)False|(name)DateTime|(widget_displayname)Date+%26+time|(width)|(height)^}
Any input is greatly appreciated!
Have you checked this article http://devnet.kentico.com/articles/how-to-resolving-the-inline-controls? It is pretty old. But CMS.ExtendedControls.ControlsHelper.ResolveDynamicControls is available in newer Kentico versions. I think it might resolve you issue.

Command Not Handled Exception

I'm new to Domino Designer. I'm trying to modify an existing application which is running on a remote server. I create a blank xPage and view in browser and it works. I add a label and view in browser and it works. I add a combo box and setup a data source for my xPage. The data source is in the current application and I'm using a view. I setup my combo to point to that data source and specify BindTo value. I view it in browser and I get Error 500 "HTTP Web Server: Command Not Handled Exception" I can open the view that I've used and see all the data in the view. I can even add, edit, and delete from the view.
Ideas... Thnxs in advance.
Additional Info. I've added a "View" from "Container Controls" and used the same data source and the same view and it also works in the browser.
The error being printed is:
javax.faces.el.PropertyNotFoundException: Error getting property 'CompanyName' from bean of type lotus.domino.local.View
com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:119)
com.ibm.xsp.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:144)
com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:182)
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:163)
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.j‌​ava:257)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:150) ....
This was already answered in the comments, but I want to write a better answer.
The problem in this case is that a view data source is being used for editing a document. Directly, this is not a possibility, though there are a few great ways to get around this. The first way, and my favorite, is to use an inline form. I think the Extension Library Demo database offers a few great examples of how to go about doing this. One way is to use a tooltip dialog. Another way is an inline form. A repeater is used and for every row in the view, a hidden panel can be made which contains the document data source and all field which are required to be changeable. By clicking on a button or link, the panel is made visible. This is my favorite variant because it is simple, quick, and generally looks great.
Another way to go about this is to have a view data source only, but use scripts to retrieve the document and set the values in the background and then save and release. It all depends on what you are trying to achieve.
My main recommendation is to look at the ExtLib demo and take a look at what they are doing there.

In XPages Mobile App / Mobile Control, how to make picklist

I have two pages, one page for input, another page for the options, how to send value form page to another page on xPages Mobile Controls, or is there another way to make like this.
See my sample page:
1. Page 1:User Input
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_1_form_user_input.jpg
Page 2:Picklist
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_2_user_choice_PickList.jpg
note: the built-in typeahead not posible
Regards,
Danny
The in built type ahead is missing the dojo tundra.css file when using the single page app control. This file comes with Dojo its just not being included. Import this file to get the type ahead to work.
I'm unsure as to what you mean about passing value from one page to another, you can submit data to a document and open it in another page, add it to a scoped variable, add a parameter to the URL. All of these options will work.
Have a look at my blog post on this topic. There are a couple of gotchas to get around, most notably, ensuring the the page with your document datasource gets recalculated at the correct time. I'm working on a NotesIn9 on it.
Part 3 covers a couple of amendments to get it working with existing documents and includes a sample page that will work in the Extension Library Demo db. Note the extra view that needs to be created and other details in Part Two.
http://www.intec.co.uk/xpages-mobile-controls-and-value-pickers-part-three-client-side-approach-extended/

Viewstate of UserControl failing to load after migrating 2.0 to 4.0

I have a gridview and a usercontrol. On Rowediting event i am binding details in usercontrol. But when any postback happens inside that usecontrol, then following excetion generates.
"Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request"
The code was working fine with framework version2.0. After migrating our website to framework version 4.0 this is not working
Note: I am not adding/replacing controls dynamically
This is resolved now. The problem was i was opening user control in row editing event and was not actually editing the row. i placed e.cancel=true; in row editing event which solved this issue

MOSS 2007 - Using Connectable WebPart - Consumer has TextBox

I have 2 webparts which are connected, where the provider sends a string to the consumer.
However it fails to work if I put any TextBox controls in the consumer webpart. (works fine if I use a Label or Literal control.
The idea is that the consumer is to be composed of form controls like TextBoxes.
e.g. the codeproject sample at http://www.codeproject.com/KB/sharepoint/ConnectingCustomWebParts.aspx
Works fine... until you replace the consumer Label control with a TextBox.
Any help gratefully received.
Well, if this still needs an answer....
Why it would work with one control and not another, I'm not sure. The reason I couldn't get it to work consistently as is coded in that sample is due to the issues brought to fore in this article. The data just isn't always there in the create controls part of the web part life cycle. I had much better luck getting my data and putting it somewhere, either the session or the viewstate during the ConnectionConsumer event, then setting the value to the control that needed to display it in the OnPreRender event, or just somehow binding to the control, say in a grid, and just calling refresh on the List I was using as a datasource in the OnPreRender, calling Refresh in the create controls didn't work reliably, only in OnPreRender.
Once I truly grokked the web part lifecycle, things became much simpler for me, and finally taught me why in Java portlets they went with the post/redirect/get cycle to try and avoid this very granular coordination between various portlets on a page.

Resources