Control 'grdstudent' of type 'GridView' must be placed inside a form tag with runat=server - Free Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server,WCF,Entity framework snippets and tutorial

Control 'grdstudent' of type 'GridView' must be placed inside a form tag with runat=server

Introduction: in this artcile I will explain how to resolve the problem Control 'grdstudent' of type 'GridView' must be placed inside a form tag with runat=server when Export Data from Data controls i.e. Gridview, Datalist etc.
runat server

Description:
In the last article i have explained A page can have only one server-side Form tag.

Error occur when we try to Export the Data from Controls to Pdf, Excel, Word, CSV. To resolve this problem add one function:

public override void VerifyRenderingInServerForm(Control control)
    {
        /* Verifies that the control is rendered */
    }


After adding this fuction in code behind the problem has been resolved. It would solve you problem.

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.

Share this

Share on FacebookTweet on TwitterPlus on Google+


EmoticonEmoticon