开发者

problem with pagestate when two links in aspx page

I have two links in my aspx page.

one link "A" when i click it ...it is downloading some document when i click it other link "B" when I click it ....it redirects me to some other page.

Both links triggers function from code behind. Both links works fine when i first come onto page but when i click A it shows me message to download it "open" "save" "cancel"

problem is when i click cancel I remain on the same page but now no links work neither link A nor link B.

I guess there is some problem with the state my page is in . How i can avoid this? Code so far:

<asp:Linkbutton ID="linkbutton1" runat="server" Text="A开发者_JAVA百科" onClick="Codebehindmethod" />
<asp:Linkbutton ID="linkbutto2" runat="server" Text="B" onClick="Codebehindmethod1" > 


How are you sending the document to the client?

Is your code in the event handler similar to this?

Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=foo." + fileNameExtension);
Response.BinaryWrite(renderedBytes);
Response.End();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜