adsense

Thursday, February 17, 2011

downloading a .pdf document from a datagrid which is under a update panel

I want to get the GridView's html code before page render. I just used GridView.RenderControl() method.   The gridview was inside an update panel.

----------Here Comes My Code---------------
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        GridView gv = new GridView(); //Dummy data gridview
        gv.DataSourceID = "SqlDataSource1";
        
        gv.DataBind();
        try
        {
            gv.RenderControl(htmlWrite);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
When you run the above code following error will be generated
Error:

sys.webforms.PageRequestManagerParserException: The message received from the server could not be parsed.Common causes for this error are when the response is modified by calls to Response.Write ,response filters ,http modules or server trace is enabled

Details:Error Parsing near "%Pdf-1.4" %[] []


I  solved the issue with the below code

<Triggers >
<ajax:PostBackTrigger ControlID ="btnPrint" />

</Triggers>

Wednesday, February 2, 2011

Get Microsoft WebMatrix and Streamline Your Site Development Now

WebMatrix is the easiest way to build, test and deploy Web sites. WebMatrix installs in minutes and elegantly integrates a Web server, database and programming frameworks into a single integrated experience. Connect from WebMatrix to Visual Studio or SQL Server Express to take advantage of Microsoft's professional tools and servers

Read more and download
http://www.microsoft.com/web/webmatrix/

Cheers
samitha

Top 7 Tools for Microsoft Azure

Developers always build an ecosystem of small tools and utilities around every platform they love and Microsoft Azure is no different. Take a look at seven great tools to make your cloud computing life a little easier. They range from making it easier to work with your storage accounts, to migrating data, to one that will even help you manage your charges. Spend some time this holiday season sharpening your saw and playing with some new tools
read more
http://www.codeguru.com/csharp/.net/article.php/c18451

cheers
samitha

Preventing Security Exploits Caused by Concurrency Bugs

Jinx, a new software quality tool that reliably identifies concurrency bugs, points out the causality
of such bugs and enables developers to verify that their patches and software fixes have eliminated these bugs.

read more
http://adtmag.com/whitepapers/2010/11/corensic-preventing-security-exploits-caused-by-concurrency.aspx?tc=page0&pc=c342em02&utm_source=webmktg&utm_medium=E-Mail&utm_campaign=c342em02

cheers
samitha