Click here to Skip to main content
15,890,123 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCould somebosy help me this rendercontrol issue Pin
Ersan Ercek19-Nov-09 6:40
Ersan Ercek19-Nov-09 6:40 
AnswerRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur19-Nov-09 7:56
professionalAbhishek Sur19-Nov-09 7:56 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Ersan Ercek19-Nov-09 9:07
Ersan Ercek19-Nov-09 9:07 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur19-Nov-09 20:40
professionalAbhishek Sur19-Nov-09 20:40 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Ersan Ercek19-Nov-09 20:55
Ersan Ercek19-Nov-09 20:55 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur19-Nov-09 21:08
professionalAbhishek Sur19-Nov-09 21:08 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Ersan Ercek20-Nov-09 0:59
Ersan Ercek20-Nov-09 0:59 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur21-Nov-09 9:25
professionalAbhishek Sur21-Nov-09 9:25 
Ohh... I am sorry Ersan, as you are about to render the same page which is loading, the server will actually put the gridview inside the Form until it passes the Page_Load. Do this :

Place

<%@ Page ... EnableEventValidation = "false" %>
in the page directive of your page. Now place this in the code behind :
public override void VerifyRenderingInServerForm(Control control)
{
}


Overriding this function will automatically disable the checking of server side form element. And as I have also disabled Event Validation, so any event validation error generation while rendering the Gridview will also be suppressed.

So your server side code will look like :
StringBuilder sb = new StringBuilder();
StringWriter strw = new StringWriter(sb);
HtmlTextWriter htmlw = new HtmlTextWriter(strw);
this.dgSiparisler.RenderControl(htmlw);
string html = sb.ToString();

No need to create a new form element. Just do it, I am sure it will work.

Rose | [Rose]

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript

GeneralRe: Could somebosy help me this rendercontrol issue Pin
Ersan Ercek23-Nov-09 0:28
Ersan Ercek23-Nov-09 0:28 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur24-Nov-09 21:42
professionalAbhishek Sur24-Nov-09 21:42 
AnswerRe: Could somebosy help me this rendercontrol issue Pin
The Man from U.N.C.L.E.19-Nov-09 7:59
The Man from U.N.C.L.E.19-Nov-09 7:59 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
The Man from U.N.C.L.E.19-Nov-09 8:01
The Man from U.N.C.L.E.19-Nov-09 8:01 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Abhishek Sur19-Nov-09 8:10
professionalAbhishek Sur19-Nov-09 8:10 
GeneralRe: Could somebosy help me this rendercontrol issue Pin
Ersan Ercek19-Nov-09 8:20
Ersan Ercek19-Nov-09 8:20 
QuestionOpen Documents from List Box Pin
Paul Unsworth19-Nov-09 4:47
Paul Unsworth19-Nov-09 4:47 
AnswerRe: Open Documents from List Box Pin
Abhijit Jana19-Nov-09 5:04
professionalAbhijit Jana19-Nov-09 5:04 
GeneralRe: Open Documents from List Box Pin
Paul Unsworth19-Nov-09 5:33
Paul Unsworth19-Nov-09 5:33 
GeneralRe: Open Documents from List Box Pin
Christian Graus19-Nov-09 6:21
protectorChristian Graus19-Nov-09 6:21 
GeneralRe: Open Documents from List Box Pin
Paul Unsworth19-Nov-09 21:24
Paul Unsworth19-Nov-09 21:24 
AnswerRe: Open Documents from List Box Pin
Abhishek Sur19-Nov-09 8:01
professionalAbhishek Sur19-Nov-09 8:01 
GeneralRe: Open Documents from List Box Pin
Paul Unsworth19-Nov-09 21:26
Paul Unsworth19-Nov-09 21:26 
Questioni want email sending program in vb Pin
sura94519-Nov-09 4:06
sura94519-Nov-09 4:06 
AnswerRe: i want email sending program in vb Pin
dan!sh 19-Nov-09 4:14
professional dan!sh 19-Nov-09 4:14 
AnswerRe: i want email sending program in vb Pin
Abhijit Jana19-Nov-09 4:15
professionalAbhijit Jana19-Nov-09 4:15 
GeneralRe: i want email sending program in vb Pin
Abhishek Sur19-Nov-09 8:21
professionalAbhishek Sur19-Nov-09 8:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.