I have used javascript coding in my Asp.Net application like this
<script language="javascript">
function Button1_Click()
{
//switch(Select1.selectedIndex)
//Case 0 // Use Automation.;
var sHTML;
sHTML =document.forms(0).children("dg1").outerhtml;
var oXL, oBook;
oXL = new ActiveXObject("Excel.Application");
//Set oXL = new ActiveXObject(".Application");
oBook = oXL.Workbooks.Add;
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML;
oBook.HTMLProject.RefreshDocument;
oXL.Visible = true;
oXL.UserControl = true;
//Case 1 // Use MIME Type (In a New Window).;
window.open("bottom.aspx?bExcel=1")
//Case 2 // Use MIME Type (In the Frame).;
//window.parent.frames("bottom").navigate "bottom.aspx?bExcel=1";
}
</script>
When i run it i get an error: "object required" in this particular line:
sHTML =document.forms(0).children("dg1").outerhtml;
Can anybody help me please?