ラベル datagrid の投稿を表示しています。 すべての投稿を表示
ラベル datagrid の投稿を表示しています。 すべての投稿を表示

2012年3月26日月曜日

Response.write in Update Panel

Is it possible to use a response.write in an update panel? I have a button converting a datagrid to excel using response.write. The button will work fine outside of the update panel but when I try it inside the update panel I am getting an error.

Try a response.clear

 Response.Clear() Response.AddHeader("content-disposition","attachment; filename=Survey_Results.xls") Response.Charset ="" Response.Cache.SetCacheability(HttpCacheability.NoCache)Dim stringWriterAs System.IO.StringWriter =New System.IO.StringWriter()Dim htmlWriteAs System.Web.UI.HtmlTextWriter =New HtmlTextWriter(stringWriter) stringWriter.Write("Question,Option,Option Type,Is Correct?,UserID" & vbCrLf)Dim colSurveyResultInfoAs List(Of SurveyResultInfo) = SurveyOptionController.GetSurveyResultData(ModuleId)Dim objSurveyResultInfoAs SurveyResultInfoFor Each objSurveyResultInfoIn colSurveyResultInfo stringWriter.Write(objSurveyResultInfo.Question &"," & objSurveyResultInfo.OptionName &"," & objSurveyResultInfo.OptionType &"," & objSurveyResultInfo.IsCorrect &"," & objSurveyResultInfo.UserId & vbCrLf)Next Response.Write(stringWriter.ToString()) Response.Flush() Response.Close()

After a little more research I found the answer.

<Triggers>
<asp:PostBackTrigger ControlID="btnExport" />
</Triggers>

http://ajax.asp.net/docs/mref/T_System_Web_UI_PostBackTrigger.aspx


You can't send a traditional octet stream file response in a partial postback because there isn't an HTTP response coming back to the browser. It's just a string returned to the XmlHTTPRequest.

However, you canuse an iframe to accomplish asynchronous file downloads.

2012年3月21日水曜日

rounded corners extender

I'm trying to make my datagrid have rounded corners using the ajax rounded corners extender. When I load my page the datagrid apears and then disappears right away. In view source I see the datagrid information. Has anyone else had this problem, if so how did you fix it?

Thanks.

Does the datagrid have data in it? Datagrids disappear if empty.


Does the datagrid have data in it? Datagrids disappear if empty.


View source shows there is data in the grid. It appears then in a second disappears.

Thanks for the reply. I would really like this to work, it would make my page look so much better as everything else on the page has rounded corners.


Hi,

It's hard to tell why exactly without knowing how you implement it.

Can you show me a simple repro? It will be preferred if you can modify it a little bit to use Northwind database.