Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Wednesday, March 28, 2012

View PDF in ATLAS?

In my existing 1.1 app, I have a datagrid with a column that, when clicked, displays a pdf file. In trying to convert it to 2.0 with Atlas, the pdf will not display, no error, but no display either. The data for the pdf is stored in SQL as binary data. I have listed the code below. If anyone could shed some light onto the issue, I'd greatly appreciate it.

If dr.Read Then
Dim byData(dr.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
dr.GetBytes(0, 0, byData, 0, byData.Length)
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = True
Response.AddHeader("Content-Disposition", "inline;filename=" & strFileName)
Response.AddHeader("Accept-Header", byData.Length)
Response.ContentType = strContentType
Response.BinaryWrite(byData)
Response.Flush()
Response.Close()
End If

Again, any feedback would be appreciated.

Thanks.

I ended up diong the postback in a different page.

What you will need to do is have a link in your datagrid to another page (ie viewattachment.aspx?filename=filename) and then create a non ajax windows form page called viewattachment.aspx

In the viewattachment.aspx page_load method you can then place your response code as you mentioned above

I have written an example of thishere.
Clinton

Monday, March 26, 2012

VS 2005 IDE now unstable and crashing

I recently installed AJAX and the control toolkit, setup a sample website and it worked very slick. I have an existing app written in VB.net in VS 2005 that i am integrating the AJAX toolkit, specifically the dropdownshadow extender, scriptmanager and updatepanel, having copied the needed configuration into my web.config from the small app i wrote.

The problem is my environment is now extremenly unstable and crashes whenever i try to change a property of a control within the update panel or on any page containing an ajax control. Simply clicking on a textbox within the AJAX control will randomly cause an error screen i have never seen before saying Visual Studio has encountered an error and must restart.

Once the crash happens i cannot switch to design view as it says no AJAX tags are recognized, yet if i compile and run it works fine, not much help if i cannot design tho. I strip the tags out in code view and i am off again until the next crash.

After some crashes i try to drag an AJAX control onto a page and i get an 'Error: control could not be created' , control is not recognized. I have to reboot my system to get it to work.

I installed SP1 Beta and the problem still persists. This is very frustrating as the controls are working great other than when they crash my IDE. I will attach a screenshot if needed once i get in front of my dev station.

Hopefully someone has had this problem already.

Cheers!! And great work so far!!

I have never seen that, but can be a bug fixed in the new SP1 for VS2005http://alpascual.com/blog/al/archive/2006/12/15/Visual-Studio-2005-Service-Pack-1-has-been-released.aspx

See if installing it fixes your problems


This happens to me much more often as well after installing AJAX.

Sorry been away for a while, i installed SP1 but still unstable. I also constantly get

Error 182 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site.

It does not occur everytime but when it does i cannot change to design view. The site still runs fine but it is frustrating that i have to reboot or wait for the 'magic' in the air to sort the problem out. I have seen this in many forums but no one ever has an answer yet.


VS2005 often crashes when I try to shut it down with SP1 and SP1 for Vista. I get memory corrupt errors and it can't recognize the ASP.NET Ajax tags most of the time. I am running Vista x64 RC1 though so some problems could be related to that...