Click here to Skip to main content
15,920,508 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Error Pin
himanshu25619-Jul-09 1:12
himanshu25619-Jul-09 1:12 
Questionupdate a numeric datatype value in a gridview Pin
haleemasher8-Jul-09 20:21
haleemasher8-Jul-09 20:21 
Questionlinkbutton in gridview Pin
vikas shukla8-Jul-09 20:20
vikas shukla8-Jul-09 20:20 
AnswerRe: linkbutton in gridview Pin
Abhijit Jana8-Jul-09 20:49
professionalAbhijit Jana8-Jul-09 20:49 
Questiongadget concept how to do plz give me some idea Pin
Member 38798818-Jul-09 20:15
Member 38798818-Jul-09 20:15 
Questionplz tell me,how to compare zero value with image control url Pin
nari08208-Jul-09 20:13
nari08208-Jul-09 20:13 
AnswerRe: plz tell me,how to compare zero value with image control url Pin
Abhijit Jana8-Jul-09 20:19
professionalAbhijit Jana8-Jul-09 20:19 
QuestionPlease help with Data Grid export problem Pin
Hammad Mansoor8-Jul-09 20:03
Hammad Mansoor8-Jul-09 20:03 
I am using the following code to export Data Grid to excel. It works fine, except that it misses the leading '0's in the first column. For example, I have data in first column like '0034566'. When it exports to excel, the data is shown as '34566'. I have tried many things but it's still not working. Please help.

Imports System.Data
Imports System.IO

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment;filename=SearchDownload.xls")
Response.Charset = ""
Me.EnableViewState = False

GridView1.AllowPaging = False
Dim dtSupplier As DataTable = DirectCast(ViewState("dtSupplier"), DataTable)
GridView1.DataSource = dtSupplier
GridView1.DataBind()
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
Dim StyleAsText As String = "<style> .StyleAsText{ mso-number-format:\@;} </style>"


GridView1.RenderControl(htmlWrite)

'Response.Write(strStyle)

'Response.Write(stringWrite.ToString())
Response.Write(StyleAsText + stringWrite.ToString())

Response.End()

End Sub

Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)

End Sub
End Class
AnswerRe: Please help with Data Grid export problem Pin
Abhijit Jana8-Jul-09 20:51
professionalAbhijit Jana8-Jul-09 20:51 
GeneralRe: Please help with Data Grid export problem Pin
Hammad Mansoor8-Jul-09 21:06
Hammad Mansoor8-Jul-09 21:06 
AnswerRe: Please help with Data Grid export problem [modified] Pin
kumar_k5088-Jul-09 22:22
kumar_k5088-Jul-09 22:22 
GeneralRe: Please help with Data Grid export problem Pin
Hammad Mansoor9-Jul-09 18:46
Hammad Mansoor9-Jul-09 18:46 
Questionajax page request.forms using post method...,values inserting into db 2 times?..., Pin
Member 38798818-Jul-09 19:27
Member 38798818-Jul-09 19:27 
AnswerRe: ajax page request.forms using post method...,values inserting into db 2 times?..., Pin
Abhijit Jana8-Jul-09 19:40
professionalAbhijit Jana8-Jul-09 19:40 
GeneralRe: ajax page request.forms using post method...,values inserting into db 2 times?..., Pin
Member 38798818-Jul-09 20:17
Member 38798818-Jul-09 20:17 
GeneralRe: ajax page request.forms using post method...,values inserting into db 2 times?..., Pin
Abhijit Jana8-Jul-09 20:20
professionalAbhijit Jana8-Jul-09 20:20 
Questionlinkbutton Pin
vikas shukla8-Jul-09 19:10
vikas shukla8-Jul-09 19:10 
AnswerRe: linkbutton Pin
Abhijit Jana8-Jul-09 19:49
professionalAbhijit Jana8-Jul-09 19:49 
QuestionHow to open a word doc in firefox in a write mode using asp.net Pin
G Nathan8-Jul-09 19:10
G Nathan8-Jul-09 19:10 
AnswerRe: How to open a word doc in firefox in a write mode using asp.net Pin
PJWindsor8-Jul-09 22:39
PJWindsor8-Jul-09 22:39 
QuestionSome Basic ASP .Net Security Questions Pin
swjam8-Jul-09 18:20
swjam8-Jul-09 18:20 
QuestionCrystal Reports 2008 (12) Error when running on server Pin
Battlehammer8-Jul-09 7:32
Battlehammer8-Jul-09 7:32 
AnswerRe: Crystal Reports 2008 (12) Error when running on server Pin
Battlehammer8-Jul-09 8:06
Battlehammer8-Jul-09 8:06 
GeneralRe: Crystal Reports 2008 (12) Error when running on server Pin
Abhijit Jana8-Jul-09 8:53
professionalAbhijit Jana8-Jul-09 8:53 
GeneralRe: Crystal Reports 2008 (12) Error when running on server Pin
Battlehammer8-Jul-09 9:48
Battlehammer8-Jul-09 9:48 

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.