Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
AnswerRe: Deploy Web Service Pin
Rob Philpott27-Sep-06 9:46
Rob Philpott27-Sep-06 9:46 
QuestionRe: Deploy Web Service Pin
chacimulch27-Sep-06 10:58
chacimulch27-Sep-06 10:58 
AnswerRe: Deploy Web Service Pin
Rob Philpott27-Sep-06 20:41
Rob Philpott27-Sep-06 20:41 
QuestionRe: Deploy Web Service Pin
chacimulch28-Sep-06 2:36
chacimulch28-Sep-06 2:36 
AnswerRe: Deploy Web Service Pin
Rob Philpott28-Sep-06 3:04
Rob Philpott28-Sep-06 3:04 
GeneralRe: Deploy Web Service Pin
chacimulch28-Sep-06 3:19
chacimulch28-Sep-06 3:19 
GeneralRe: Deploy Web Service Pin
Rob Philpott28-Sep-06 3:23
Rob Philpott28-Sep-06 3:23 
Questionexport to excell Pin
galatia27-Sep-06 8:41
galatia27-Sep-06 8:41 
Hi,
i want some help with exporting detailsview to excell.I m working on a web application and i have a search page and a result page.The result page demonstrates the results of the search in a detailsview and i want to export it to excell.I use a button for that, the code of the button is :

protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";

// If you want the option to open the Excel file without saving then
// comment out the line below
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DetailsView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

}

public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}

But i have an error message :
"RegisterForEventValidation can only be called during Render();
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: RegisterForEventValidation can only be called during Render();"

Any ideas?????It's very important

Thanks galatia



galatia

AnswerRe: export to excell Pin
Jim Conigliaro27-Sep-06 9:49
Jim Conigliaro27-Sep-06 9:49 
QuestionDelete Nodes in XML with C# [modified] Pin
Raph127-Sep-06 8:40
Raph127-Sep-06 8:40 
QuestionClose all processes launched by program Pin
Vodstok27-Sep-06 8:22
Vodstok27-Sep-06 8:22 
AnswerRe: Close all processes launched by program Pin
Vodstok27-Sep-06 9:01
Vodstok27-Sep-06 9:01 
GeneralRe: Close all processes launched by program Pin
Dave Kreskowiak27-Sep-06 9:24
mveDave Kreskowiak27-Sep-06 9:24 
GeneralRe: Close all processes launched by program Pin
Vega0227-Sep-06 11:11
Vega0227-Sep-06 11:11 
QuestionStarting a Process without Windows "Run" Window Pin
Gareth H27-Sep-06 8:17
Gareth H27-Sep-06 8:17 
AnswerRe: Starting a Process without Windows "Run" Window Pin
Not Active27-Sep-06 8:36
mentorNot Active27-Sep-06 8:36 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Gareth H27-Sep-06 8:43
Gareth H27-Sep-06 8:43 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Not Active27-Sep-06 8:55
mentorNot Active27-Sep-06 8:55 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Dave Kreskowiak27-Sep-06 9:13
mveDave Kreskowiak27-Sep-06 9:13 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Gareth H27-Sep-06 23:03
Gareth H27-Sep-06 23:03 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Dave Kreskowiak28-Sep-06 2:14
mveDave Kreskowiak28-Sep-06 2:14 
QuestionProgrammatically installing printer driver Pin
sharkbait27-Sep-06 7:47
sharkbait27-Sep-06 7:47 
AnswerRe: Programmatically installing printer driver Pin
Dave Kreskowiak27-Sep-06 10:14
mveDave Kreskowiak27-Sep-06 10:14 
Questionhow to print datagrid.rows in vs 2005 ? Pin
hdv21227-Sep-06 7:47
hdv21227-Sep-06 7:47 
AnswerRe: how to print datagrid.rows in vs 2005 ? Pin
Eric Dahlvang27-Sep-06 9:21
Eric Dahlvang27-Sep-06 9: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.