Sunday, January 22, 2012

Embed html in label - devexpress





Many times I came across scenario in which I need to add HTML tag into the text of the ASPxLabel or TextBox etc.


Easiest way to accomplish this is setting EncodeHTML to false - which do not allow editor to keep any of its values that are HTML as HTML and RENDERED as PURE HTML.


e.g. through server side...


aspxlabel.text = "111<br>2222";
aspxlabel.encodehtml = false;




<dxe:ASPxLabel runat="server" ID="ASPxLabel1" ClientInstanceName="lblShortFont" class="largeDonationsStyle"  EncodeHtml ="false" Text="bkasd asd <a href='mailto:info@kaliya.com'> info@kaliya.com</a> or call (800) 400-2000" Font-Size="X-Small">
</dxe:ASPxLabel>

Monday, January 16, 2012

CallBack and Postback differences

Awesome explanation about Callback and postback

http://stackoverflow.com/questions/365100/difference-between-a-postback-and-a-callback

BELOW CONTENT IS COPIED FROM STACKOVERFLOW:


A Postback occurs when the data (the whole page) on the page is posted from the client to the server..ie the data is posted-back to the server, and thus the page is refreshed (redrawn)...think of it as 'sending the server the whole page (asp.net) full of data'.
On the other hand, a callback is also a special kind of postback, but it is just a quick round-trip to the server to get a small set of data (normally), and thus the page is not refreshed, unlike with the postback...think of it as 'calling the server, and receiving some data back'
With Asp.Net, the ViewState is not refreshed when a callback is invoked, unlike with a postback.
The reason that the whole page is posted with ASP.Net is because ASP.Net encloses the whole page in a <form> with a post method, and so when a submit button is clicked in the page, the form is sent ot the server with all of the fields that are in the form...basically the whole page itself
If you are using FireBug (for Firefox), you can actually see callbacks being invoked to the server in theConsole. That way, you will see what specific data is being sent to the server (Request) and also the data the server sent you back (Response)

The below image illustrates the Page Life Cycles of both a postback and a callback in a ASP.NET based Website:
ASP.NET Page Life Cycles