This is a migrated thread and some comments may be shown as answers.

RadRibbonBar1 + Response error

1 Answer 41 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 30 Mar 2011, 07:54 AM

Hi All,
I have problem with RibbonBar, I have it on my page, it is added to ajaxmanager. The code on the page look like this

<telerik:RibbonBarTab Text="MyApp">

 

<telerik:RibbonBarGroup Text ="Docs">

 

 

<Items >

 

 

<telerik:RibbonBarButton ID="rbbHelp" Size="Large" Text="Help" ImageUrlLarge="Ikcsy/Png/Help.png" />

 

 

 

 

 

then in code file a have a fuction

protected void RadRibbonBar1_ButtonClick(object sender, RibbonBarButtonClickEventArgs e)

{

 

 

 

 

 

switch

(e.Button.Text.ToString())

 

 

{

 

 

case "Help":
try
{

 

 

Response.Clear();

 

 

Response.ContentType =

 

"text/pdf";

 

Response.AppendHeader("Content-Disposition", "attachment; filename=" + "HelpFile" + ".pdf" );

 

 

 

 

string file_path ="\\Help\\HelpFile.pdf";

 

 

Response.TransmitFile(file_path);
Response.End();

 

 

}

 

catch(Exception ex)

 

 

{

 

 

 

 

}

 

break;

 

 

 

}
}
after I clicked the button i get an error after Response.End :
ex = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} and after this I get on page jscript error Sys.WebForms.PageRequestManagerParserErrorException. What can I do to download/transmit the file correctly ?

Regargs.
Tomek

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 05 Apr 2011, 12:48 PM
Hi Tomasz,

Searching around the Web for this error and its possible cause gives me the impression it is not related to RadRibbonBar.

Can you please try transmitting the file on the click event of an ASP.NET Button? If the error occurs again, then the problem is somewhere else and I suggest you look at the solutions other people have posted as responses to the threads in the above search results.

All the best,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RibbonBar
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or