Ticket Q388623
Visible to All Users

Render() vs GetHtml()

created 13 years ago

Hello,
to render a DevExpress control to Html you provide to methods Render() and GetHtml(). On your demo pages it looks as if you choose them randomly. Therefor my question: Can you clarify when to use Render() and in which cases to use GetHtml()? What are the differences? There is not much information about it in the documentation. I found only this link regarding to this topic: http://documentation.devexpress.com/#AspNet/DevExpressWebMvcExtensionBaseClassMethodsTopic
Thanks in advance.
Best regards Philipp

Answers

created 13 years ago

Hi Philipp,
At present, the Render and GetHtml methods do the same thing: return a render string. Previously, the Render method wrote a render string to a Response directly. We have changed this behavior due to the following Breaking Change:
BC1225: The WriteLineToResponse and WriteToResponse methods of DevExpressHelper have been made obsolete.
The WriteLineToResponse method works incorrectly when partial views or templates with MVCx extentions are rendered before calling it
Thanks,
Marion

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.