D
David C
I have an asp.net 3.5 web page that displays 2 separate DetailsView
controls. I have the code below in the page-behind that works fine but it
overwrites the current page. Is there an easy way to have this open and
write to a new page or possibly add a button to the rendered page that will
go back to the previous page? Thanks. -David
Sub HtmlPrint()
Dim tw As New StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim dvtop As DetailsView = dvPropertyInfo
Response.Clear()
Response.ContentType = "text/html"
'Response.AddHeader("content-disposition",
"attachment;filename=search.xls")
Response.Charset = "ISO-8859-13"
EnableViewState = False
dvtop.AllowPaging = False
dvtop.RowStyle.BackColor = Drawing.Color.White
dvtop.AlternatingRowStyle.BackColor = Drawing.Color.White
dvtop.DataBind()
dvtop.RenderControl(hw)
Response.Write(tw.ToString())
Response.Clear()
Response.Write("<hr /><br /><br />")
Response.Clear()
Dim dv As DetailsView = dvPropertyAndBusiness
dv.RowStyle.BackColor = Drawing.Color.White
dv.AlternatingRowStyle.BackColor = Drawing.Color.White
dv.AllowPaging = False
dv.DataBind()
dv.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As
System.Web.UI.Control)
End Sub
Protected Sub BtnPrint_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnPrint.Click
HtmlPrint()
End Sub
controls. I have the code below in the page-behind that works fine but it
overwrites the current page. Is there an easy way to have this open and
write to a new page or possibly add a button to the rendered page that will
go back to the previous page? Thanks. -David
Sub HtmlPrint()
Dim tw As New StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim dvtop As DetailsView = dvPropertyInfo
Response.Clear()
Response.ContentType = "text/html"
'Response.AddHeader("content-disposition",
"attachment;filename=search.xls")
Response.Charset = "ISO-8859-13"
EnableViewState = False
dvtop.AllowPaging = False
dvtop.RowStyle.BackColor = Drawing.Color.White
dvtop.AlternatingRowStyle.BackColor = Drawing.Color.White
dvtop.DataBind()
dvtop.RenderControl(hw)
Response.Write(tw.ToString())
Response.Clear()
Response.Write("<hr /><br /><br />")
Response.Clear()
Dim dv As DetailsView = dvPropertyAndBusiness
dv.RowStyle.BackColor = Drawing.Color.White
dv.AlternatingRowStyle.BackColor = Drawing.Color.White
dv.AllowPaging = False
dv.DataBind()
dv.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As
System.Web.UI.Control)
End Sub
Protected Sub BtnPrint_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnPrint.Click
HtmlPrint()
End Sub