473,233 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

export datagrid to Excel

Hello All,

I ham using VS.NET 2003.

Have followed instructions from
http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several
other articles to no avail. I am pulling my hair out at this point. What I
have is this :

Members.aspx file:
<HTML>
<HEAD>
<title>members</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<mz:Header_Admin id="Heading1" runat="server"></mz:Header_Admin>
<mz:Menu id="Menu1" runat="server"></mz:Menu>
<asp:HyperLink id="HyperLink1" style="Z-INDEX: 105; LEFT: 144px;
POSITION: absolute; TOP: 248px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="members.aspx">Members</asp:HyperLink>
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT:
152px; POSITION: absolute; TOP: 280px"
runat="server" ForeColor="#EA9919">Add</asp:LinkButton>
<asp:LinkButton id="LinkButton2" style="Z-INDEX: 104; LEFT:
152px; POSITION: absolute; TOP: 312px"
runat="server" ForeColor="#EA9919">Remove</asp:LinkButton>
<asp:LinkButton id="LinkButton3" style="Z-INDEX: 102; LEFT:
152px; POSITION: absolute; TOP: 344px"
onclick="LinkButton3_Click" runat="server"
ForeColor="#EA9919">View</asp:LinkButton>
<asp:HyperLink id="HyperLink2" style="Z-INDEX: 103; LEFT: 136px;
POSITION: absolute; TOP: 376px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="#.aspx">Community</asp:HyperLink>
<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 504px;
POSITION: absolute; TOP: 320px" runat="server"
Text="Export to Excel"></asp:Button>
<BR>
<asp:Datagrid id="dg" runat="server" AutoGenerateColumns="True"
AllowSorting="true" AllowPaging="true"
CellPadding="3" PageSize="3" style="Z-INDEX: 107; LEFT:
464px; POSITION: absolute; TOP: 368px">
<columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" CommandName="Edit"
CausesValidation="false" ID="btnView" Text="Edit" />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:Datagrid>
</form>
</body>
</HTML>

in code behind file:

namespace myComponent.mzControls
{

public class members : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.LinkButton LinkButton2;
protected System.Web.UI.WebControls.LinkButton LinkButton3;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataGrid dg;
protected MZBusinessLayer bizObj;

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
bizObj = new MZBusinessLayer();
dg.DataSource = bizObj.GetMembers();
DataBind();
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LinkButton3.Click += new
System.EventHandler(this.LinkButton3_Click);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.dg.SelectedIndexChanged += new
System.EventHandler(this.dg_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

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

Response.Charset = "";

Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new
HtmlTextWriter(stringWrite);

dg.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}

public void LinkButton3_Click(object sender, System.EventArgs e)
{

}

private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{

}
}
}
And the error message:

Control 'dg__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside
a form tag with runat=server.
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.Web.HttpException: Control 'dg__ctl2__ctl0' of
type 'DataGridLinkButton' must be placed inside a form tag with
runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): Control 'dg__ctl2__ctl0' of type
'DataGridLinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +151
System.Web.UI.WebControls.LinkButton.AddAttributes ToRender(HtmlTextWriter
writer) +38
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
writer) +17
System.Web.UI.WebControls.DataGridLinkButton.Rende r(HtmlTextWriter
writer) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
+55
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer) +99
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.BaseDataList.Render(Html TextWriter writer) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
MarketZar.mzControls.members.Button1_Click(Object sender, EventArgs e)
+186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

I don't have any controls outside of the form. What the heck is going on
here?


Jan 25 '06 #1
4 3886
To get around this same exception, I had to hide the link button column when
rendering the datagrid to Excel. In my case, the link button column was the
last column so I used this code:

UserList_dg.Columns[UserList_dg.Columns.Count-1].Visible = false;

I only run that code when the datagrid was being rendered to Excel.

In another instance, where the link button text was data that needed to be
seen in Excel, I handled the ItemDatabound event and, in the event handler,
manually generated the content for the column as a link button when rendering
to a page and as text when rendering to Excel.

HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Frank" wrote:
Hello All,

I ham using VS.NET 2003.

Have followed instructions from
http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several
other articles to no avail. I am pulling my hair out at this point. What I
have is this :

Members.aspx file:
<HTML>
<HEAD>
<title>members</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<mz:Header_Admin id="Heading1" runat="server"></mz:Header_Admin>
<mz:Menu id="Menu1" runat="server"></mz:Menu>
<asp:HyperLink id="HyperLink1" style="Z-INDEX: 105; LEFT: 144px;
POSITION: absolute; TOP: 248px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="members.aspx">Members</asp:HyperLink>
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT:
152px; POSITION: absolute; TOP: 280px"
runat="server" ForeColor="#EA9919">Add</asp:LinkButton>
<asp:LinkButton id="LinkButton2" style="Z-INDEX: 104; LEFT:
152px; POSITION: absolute; TOP: 312px"
runat="server" ForeColor="#EA9919">Remove</asp:LinkButton>
<asp:LinkButton id="LinkButton3" style="Z-INDEX: 102; LEFT:
152px; POSITION: absolute; TOP: 344px"
onclick="LinkButton3_Click" runat="server"
ForeColor="#EA9919">View</asp:LinkButton>
<asp:HyperLink id="HyperLink2" style="Z-INDEX: 103; LEFT: 136px;
POSITION: absolute; TOP: 376px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="#.aspx">Community</asp:HyperLink>
<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 504px;
POSITION: absolute; TOP: 320px" runat="server"
Text="Export to Excel"></asp:Button>
<BR>
<asp:Datagrid id="dg" runat="server" AutoGenerateColumns="True"
AllowSorting="true" AllowPaging="true"
CellPadding="3" PageSize="3" style="Z-INDEX: 107; LEFT:
464px; POSITION: absolute; TOP: 368px">
<columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" CommandName="Edit"
CausesValidation="false" ID="btnView" Text="Edit" />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:Datagrid>
</form>
</body>
</HTML>

in code behind file:

namespace myComponent.mzControls
{

public class members : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.LinkButton LinkButton2;
protected System.Web.UI.WebControls.LinkButton LinkButton3;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataGrid dg;
protected MZBusinessLayer bizObj;

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
bizObj = new MZBusinessLayer();
dg.DataSource = bizObj.GetMembers();
DataBind();
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LinkButton3.Click += new
System.EventHandler(this.LinkButton3_Click);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.dg.SelectedIndexChanged += new
System.EventHandler(this.dg_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

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

Response.Charset = "";

Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new
HtmlTextWriter(stringWrite);

dg.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}

public void LinkButton3_Click(object sender, System.EventArgs e)
{

}

private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{

}
}
}
And the error message:

Control 'dg__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside
a form tag with runat=server.
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.Web.HttpException: Control 'dg__ctl2__ctl0' of
type 'DataGridLinkButton' must be placed inside a form tag with
runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): Control 'dg__ctl2__ctl0' of type
'DataGridLinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +151
System.Web.UI.WebControls.LinkButton.AddAttributes ToRender(HtmlTextWriter
writer) +38
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
writer) +17
System.Web.UI.WebControls.DataGridLinkButton.Rende r(HtmlTextWriter
writer) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
+55
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer) +99
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.BaseDataList.Render(Html TextWriter writer) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
MarketZar.mzControls.members.Button1_Click(Object sender, EventArgs e)
+186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

I don't have any controls outside of the form. What the heck is going on
here?


Jan 26 '06 #2
Thanks for your excellent reply. I searched the Web for a day and a
half trying to solve this issue. Others may have given good advice but
yours was the post that made the most sense and easy to implement.

Dale wrote:
To get around this same exception, I had to hide the link button column when
rendering the datagrid to Excel. In my case, the link button column was the
last column so I used this code:

UserList_dg.Columns[UserList_dg.Columns.Count-1].Visible = false;

I only run that code when the datagrid was being rendered to Excel.

In another instance, where the link button text was data that needed to be
seen in Excel, I handled the ItemDatabound event and, in the event handler,
manually generated the content for the column as a link button when rendering
to a page and as text when rendering to Excel.

HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Frank" wrote:
Hello All,

I ham using VS.NET 2003.

Have followed instructions from
http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several
other articles to no avail. I am pulling my hair out at this point. What I
have is this :

Members.aspx file:
<HTML>
<HEAD>
<title>members</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<mz:Header_Admin id="Heading1" runat="server"></mz:Header_Admin>
<mz:Menu id="Menu1" runat="server"></mz:Menu>
<asp:HyperLink id="HyperLink1" style="Z-INDEX: 105; LEFT: 144px;
POSITION: absolute; TOP: 248px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="members.aspx">Members</asp:HyperLink>
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT:
152px; POSITION: absolute; TOP: 280px"
runat="server" ForeColor="#EA9919">Add</asp:LinkButton>
<asp:LinkButton id="LinkButton2" style="Z-INDEX: 104; LEFT:
152px; POSITION: absolute; TOP: 312px"
runat="server" ForeColor="#EA9919">Remove</asp:LinkButton>
<asp:LinkButton id="LinkButton3" style="Z-INDEX: 102; LEFT:
152px; POSITION: absolute; TOP: 344px"
onclick="LinkButton3_Click" runat="server"
ForeColor="#EA9919">View</asp:LinkButton>
<asp:HyperLink id="HyperLink2" style="Z-INDEX: 103; LEFT: 136px;
POSITION: absolute; TOP: 376px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="#.aspx">Community</asp:HyperLink>
<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 504px;
POSITION: absolute; TOP: 320px" runat="server"
Text="Export to Excel"></asp:Button>
<BR>
<asp:Datagrid id="dg" runat="server" AutoGenerateColumns="True"
AllowSorting="true" AllowPaging="true"
CellPadding="3" PageSize="3" style="Z-INDEX: 107; LEFT:
464px; POSITION: absolute; TOP: 368px">
<columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" CommandName="Edit"
CausesValidation="false" ID="btnView" Text="Edit" />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:Datagrid>
</form>
</body>
</HTML>

in code behind file:

namespace myComponent.mzControls
{

public class members : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.LinkButton LinkButton2;
protected System.Web.UI.WebControls.LinkButton LinkButton3;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataGrid dg;
protected MZBusinessLayer bizObj;

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
bizObj = new MZBusinessLayer();
dg.DataSource = bizObj.GetMembers();
DataBind();
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LinkButton3.Click += new
System.EventHandler(this.LinkButton3_Click);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.dg.SelectedIndexChanged += new
System.EventHandler(this.dg_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

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

Response.Charset = "";

Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new
HtmlTextWriter(stringWrite);

dg.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}

public void LinkButton3_Click(object sender, System.EventArgs e)
{

}

private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{

}
}
}
And the error message:

Control 'dg__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside
a form tag with runat=server.
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.Web.HttpException: Control 'dg__ctl2__ctl0' of
type 'DataGridLinkButton' must be placed inside a form tag with
runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): Control 'dg__ctl2__ctl0' of type
'DataGridLinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +151
System.Web.UI.WebControls.LinkButton.AddAttributes ToRender(HtmlTextWriter
writer) +38
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
writer) +17
System.Web.UI.WebControls.DataGridLinkButton.Rende r(HtmlTextWriter
writer) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
+55
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer) +99
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.BaseDataList.Render(Html TextWriter writer) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
MarketZar.mzControls.members.Button1_Click(Object sender, EventArgs e)
+186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

I don't have any controls outside of the form. What the heck is going on
here?



Feb 15 '06 #3
I'm glad I was able to help!
--
Dale Preston
MCAD C#
MCSE, MCDBA
"greyhound" wrote:
Thanks for your excellent reply. I searched the Web for a day and a
half trying to solve this issue. Others may have given good advice but
yours was the post that made the most sense and easy to implement.

Dale wrote:
To get around this same exception, I had to hide the link button column when
rendering the datagrid to Excel. In my case, the link button column was the
last column so I used this code:

UserList_dg.Columns[UserList_dg.Columns.Count-1].Visible = false;

I only run that code when the datagrid was being rendered to Excel.

In another instance, where the link button text was data that needed to be
seen in Excel, I handled the ItemDatabound event and, in the event handler,
manually generated the content for the column as a link button when rendering
to a page and as text when rendering to Excel.

HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Frank" wrote:
Hello All,

I ham using VS.NET 2003.

Have followed instructions from
http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several
other articles to no avail. I am pulling my hair out at this point. What I
have is this :

Members.aspx file:
<HTML>
<HEAD>
<title>members</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<mz:Header_Admin id="Heading1" runat="server"></mz:Header_Admin>
<mz:Menu id="Menu1" runat="server"></mz:Menu>
<asp:HyperLink id="HyperLink1" style="Z-INDEX: 105; LEFT: 144px;
POSITION: absolute; TOP: 248px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="members.aspx">Members</asp:HyperLink>
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT:
152px; POSITION: absolute; TOP: 280px"
runat="server" ForeColor="#EA9919">Add</asp:LinkButton>
<asp:LinkButton id="LinkButton2" style="Z-INDEX: 104; LEFT:
152px; POSITION: absolute; TOP: 312px"
runat="server" ForeColor="#EA9919">Remove</asp:LinkButton>
<asp:LinkButton id="LinkButton3" style="Z-INDEX: 102; LEFT:
152px; POSITION: absolute; TOP: 344px"
onclick="LinkButton3_Click" runat="server"
ForeColor="#EA9919">View</asp:LinkButton>
<asp:HyperLink id="HyperLink2" style="Z-INDEX: 103; LEFT: 136px;
POSITION: absolute; TOP: 376px"
runat="server" ForeColor="#F2BD73"
NavigateUrl="#.aspx">Community</asp:HyperLink>
<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 504px;
POSITION: absolute; TOP: 320px" runat="server"
Text="Export to Excel"></asp:Button>
<BR>
<asp:Datagrid id="dg" runat="server" AutoGenerateColumns="True"
AllowSorting="true" AllowPaging="true"
CellPadding="3" PageSize="3" style="Z-INDEX: 107; LEFT:
464px; POSITION: absolute; TOP: 368px">
<columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" CommandName="Edit"
CausesValidation="false" ID="btnView" Text="Edit" />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:Datagrid>
</form>
</body>
</HTML>

in code behind file:

namespace myComponent.mzControls
{

public class members : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.LinkButton LinkButton2;
protected System.Web.UI.WebControls.LinkButton LinkButton3;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataGrid dg;
protected MZBusinessLayer bizObj;

private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
bizObj = new MZBusinessLayer();
dg.DataSource = bizObj.GetMembers();
DataBind();
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.LinkButton3.Click += new
System.EventHandler(this.LinkButton3_Click);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.dg.SelectedIndexChanged += new
System.EventHandler(this.dg_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

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

Response.Charset = "";

Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new
HtmlTextWriter(stringWrite);

dg.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

}

public void LinkButton3_Click(object sender, System.EventArgs e)
{

}

private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{

}
}
}
And the error message:

Control 'dg__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside
a form tag with runat=server.
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.Web.HttpException: Control 'dg__ctl2__ctl0' of
type 'DataGridLinkButton' must be placed inside a form tag with
runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): Control 'dg__ctl2__ctl0' of type
'DataGridLinkButton' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +151
System.Web.UI.WebControls.LinkButton.AddAttributes ToRender(HtmlTextWriter
writer) +38
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
writer) +17
System.Web.UI.WebControls.DataGridLinkButton.Rende r(HtmlTextWriter
writer) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
+55
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer) +99
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer) +7
System.Web.UI.WebControls.BaseDataList.Render(Html TextWriter writer) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
MarketZar.mzControls.members.Button1_Click(Object sender, EventArgs e)
+186
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

I don't have any controls outside of the form. What the heck is going on
here?



Feb 17 '06 #4
Gents,

I have been able to generate the Excel document with no problems. Except
one thing that, of course, our users complain about.

The process seems to automatically insert a blank row at the top of the
Excel document. Or, in other words, it starts the output on Row 2.

Is there a way to prevent this and start at Row 1?

Thanx,

Shawn K Haase

===============================================

"Dale" wrote:
I'm glad I was able to help!
--
Dale Preston
MCAD C#
MCSE, MCDBA
"greyhound" wrote:
Thanks for your excellent reply. I searched the Web for a day and a
half trying to solve this issue. Others may have given good advice but
yours was the post that made the most sense and easy to implement.

Dale wrote:
To get around this same exception, I had to hide the link button column when
rendering the datagrid to Excel. In my case, the link button column was the
last column so I used this code:

UserList_dg.Columns[UserList_dg.Columns.Count-1].Visible = false;

I only run that code when the datagrid was being rendered to Excel.

In another instance, where the link button text was data that needed to be
seen in Excel, I handled the ItemDatabound event and, in the event handler,
manually generated the content for the column as a link button when rendering
to a page and as text when rendering to Excel.

HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Frank" wrote:

> Hello All,
>
> I ham using VS.NET 2003.
>
> Have followed instructions from
> http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several
> other articles to no avail. I am pulling my hair out at this point. What I
> have is this :
>
> Members.aspx file:
> <HTML>
> <HEAD>
> <title>members</title>
> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" Content="C#">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> </HEAD>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">
> <mz:Header_Admin id="Heading1" runat="server"></mz:Header_Admin>
> <mz:Menu id="Menu1" runat="server"></mz:Menu>
> <asp:HyperLink id="HyperLink1" style="Z-INDEX: 105; LEFT: 144px;
> POSITION: absolute; TOP: 248px"
> runat="server" ForeColor="#F2BD73"
> NavigateUrl="members.aspx">Members</asp:HyperLink>
> <asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT:
> 152px; POSITION: absolute; TOP: 280px"
> runat="server" ForeColor="#EA9919">Add</asp:LinkButton>
> <asp:LinkButton id="LinkButton2" style="Z-INDEX: 104; LEFT:
> 152px; POSITION: absolute; TOP: 312px"
> runat="server" ForeColor="#EA9919">Remove</asp:LinkButton>
> <asp:LinkButton id="LinkButton3" style="Z-INDEX: 102; LEFT:
> 152px; POSITION: absolute; TOP: 344px"
> onclick="LinkButton3_Click" runat="server"
> ForeColor="#EA9919">View</asp:LinkButton>
> <asp:HyperLink id="HyperLink2" style="Z-INDEX: 103; LEFT: 136px;
> POSITION: absolute; TOP: 376px"
> runat="server" ForeColor="#F2BD73"
> NavigateUrl="#.aspx">Community</asp:HyperLink>
> <asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 504px;
> POSITION: absolute; TOP: 320px" runat="server"
> Text="Export to Excel"></asp:Button>
> <BR>
> <asp:Datagrid id="dg" runat="server" AutoGenerateColumns="True"
> AllowSorting="true" AllowPaging="true"
> CellPadding="3" PageSize="3" style="Z-INDEX: 107; LEFT:
> 464px; POSITION: absolute; TOP: 368px">
> <columns>
> <asp:TemplateColumn>
> <ItemTemplate>
> <asp:LinkButton runat="server" CommandName="Edit"
> CausesValidation="false" ID="btnView" Text="Edit" />
> </ItemTemplate>
> </asp:TemplateColumn>
> </columns>
> </asp:Datagrid>
> </form>
> </body>
> </HTML>
>
>
>
> in code behind file:
>
> namespace myComponent.mzControls
> {
>
> public class members : System.Web.UI.Page
> {
> protected System.Web.UI.WebControls.HyperLink HyperLink1;
> protected System.Web.UI.WebControls.LinkButton LinkButton1;
> protected System.Web.UI.WebControls.LinkButton LinkButton2;
> protected System.Web.UI.WebControls.LinkButton LinkButton3;
> protected System.Web.UI.WebControls.HyperLink HyperLink2;
> protected System.Web.UI.WebControls.Button Button1;
> protected System.Web.UI.WebControls.DataGrid dg;
> protected MZBusinessLayer bizObj;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> if(!IsPostBack)
> {
> bizObj = new MZBusinessLayer();
> dg.DataSource = bizObj.GetMembers();
> DataBind();
> }
> }
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> //
> // CODEGEN: This call is required by the ASP.NET Web Form Designer.
> //
> InitializeComponent();
> base.OnInit(e);
> }
>
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.LinkButton3.Click += new
> System.EventHandler(this.LinkButton3_Click);
> this.Button1.Click += new System.EventHandler(this.Button1_Click);
> this.dg.SelectedIndexChanged += new
> System.EventHandler(this.dg_SelectedIndexChanged);
> this.Load += new System.EventHandler(this.Page_Load);
>
> }
> #endregion
>
> private void Button1_Click(object sender, System.EventArgs e)
> {
> Response.Clear();
> Response.AddHeader("content-disposition",
> "attachment;filename=FileName.xls");
>
> Response.Charset = "";
>
> Response.Cache.SetCacheability(HttpCacheability.No Cache);
>
> Response.ContentType = "application/vnd.xls";
>
> System.IO.StringWriter stringWrite = new System.IO.StringWriter();
>
> System.Web.UI.HtmlTextWriter htmlWrite = new
> HtmlTextWriter(stringWrite);
>
> dg.RenderControl(htmlWrite);
>
> Response.Write(stringWrite.ToString());
>
> Response.End();
>
> }
>
> public void LinkButton3_Click(object sender, System.EventArgs e)
> {
>
> }
>
> private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
> {
>
> }
> }
> }
>
>
> And the error message:
>
> Control 'dg__ctl2__ctl0' of type 'DataGridLinkButton' must be placed inside
> a form tag with runat=server.
> 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.Web.HttpException: Control 'dg__ctl2__ctl0' of
> type 'DataGridLinkButton' must be placed inside a form tag with
> runat=server.
>
> Source Error:
>
> An unhandled exception was generated during the execution of the current web
> request. Information regarding the origin and location of the exception can
> be identified using the exception stack trace below.
>
> Stack Trace:
>
>
> [HttpException (0x80004005): Control 'dg__ctl2__ctl0' of type
> 'DataGridLinkButton' must be placed inside a form tag with runat=server.]
> System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +151
> System.Web.UI.WebControls.LinkButton.AddAttributes ToRender(HtmlTextWriter
> writer) +38
> System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
> writer) +17
> System.Web.UI.WebControls.DataGridLinkButton.Rende r(HtmlTextWriter
> writer) +25
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
> System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
> +55
> System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
> System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
> writer) +7
> System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer) +99
> System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
> System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
> writer) +7
> System.Web.UI.WebControls.BaseDataList.Render(Html TextWriter writer) +27
> System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
> MarketZar.mzControls.members.Button1_Click(Object sender, EventArgs e)
> +186
> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
> eventArgument) +57
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
> sourceControl, String eventArgument) +18
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
> System.Web.UI.Page.ProcessRequestMain() +1292
>
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
> Version:1.1.4322.2032
>
>
>
> I don't have any controls outside of the form. What the heck is going on
> here?
>
>
>
>
>


Mar 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric | last post by:
Dear All, I want to export datagrid content to a Excel file, the code just like below: Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Me.EnableViewState = False Dim...
2
by: Bidarkota | last post by:
Hi, I have a DataGrid in which there are some images and Data are displayed and in the webform.asp page i am using some stylesheets. when i export the datagrid all the images are also exported...
3
by: Bidarkota | last post by:
When i export DataGrid to Excel all the HTML contents are also exporting to excel. i am using stylesheets in the ASPX Page and i am getting an alert message that stylesheets are missing. i need to...
0
by: sunilkumar Reddy via DotNetMonster.com | last post by:
hai all first we have taken binded grid Export to excel data from ultrawebgrid (or) datagrid rows, Each row data Expoting to one worksheet in excel workbook, like as grid row1 data contain...
0
by: kieran | last post by:
Hi, I have an 'export to excel' button on my Datagrid. All works well except that on my Datagrid, I have sub total rows. The subtotal rows use colspan so that the subtotals are given above...
6
by: Sridhar | last post by:
Hi, I have to export data inside the datagrid into an excel worksheet. I have to do this on button click event. I am trying to do like this. First get the DataTable from the datagrid and...
7
by: mattmerc | last post by:
Hi all, We have all seen lot of method for exporting datagrids to Excel. I have a slightly different need. I think it should be easy to accomplish but I am not sure how. I would like when a user...
19
by: cj2 | last post by:
#1 Is there a quick way to export a datatable to an excel file? Or delimited file? #2 Where is the appropriate Microsoft monitored group to ask about writing reports in SQL Reporting services...
5
by: Reggie | last post by:
Hi and TIA! I have an export procedure that exports my data from my datagrids to excel. The problem is that I lose leading zero's cause excel removes them and doesn't treat them as text. Is it...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.