Cannot export content of ultrawebgrid to excel spreadsheet from WebDialog - c#

I'm using window.showModalDialog to open a modal window using Javascript. I have to include this line in the < HEAD > html of the modal window: <base target=_self> because whenever that page posted back, it would spawn off a new window!!
In this Modal Window I need to have a File Download functionality. The problem is that using the File Download dialog don't popup, but if I remove the the File Download dialog appears but then again, another window shows off. Is there by any chance that I can disable <base target_self> while I am downloading the content of my grid? By the way, I am using Infragistics UltraWebGridExcelExporter for this.
Thanks everyone.

As I mentioned this is a well known problem. One possible solution (I haven't got a chance to try it, but it seems logical) for the button that initiates download onClientClick try adding following JavaScript code:
document.getElementsByTagName("base")[0].setAttibute("target","")
it will change base target to blank, but only for duration of download.

Related

To save webpage as image

I have to save webpage as image by passing page URL,i have found one solution on this thread Convert webpage to image from ASP.NET[^] but it doesn't give me proper image(e.g. tried URL http://www.bugmuncher.com/).
Also tried HTML to Image in C#[^] but not able to deal with IViewObject interface ,basically not able to add reference to get this interface.
I have to do something like http://www.usersnap.com does.I made it work on FF,Chrome and IE9 by using canvas element which is unfortunately not supported by IE8.
Can i get proper working solution for my need???
i think you mean taking a screenshot.
Here you are a link about it.
Capture screenshot of active window?
But here i found on the site that just you want. Please check it.
Convert webpage to image from ASP.NET
The webpage can be saved as image by 2 methods.
1. Press ctrl+p
2. Select "Send to onenote" in print prompt window.
3. Press ok.
Now the image can be saved from the microsoft office -> microsoft onenotebook and rightclick on your content. save as the image file.
Second method is by using snapshot via snipping tool.

Download Dialog Box

How to change Design of Download Dialog Box in C#.Net?
How can I slove this problem?
(or)
How to hide Current Source File Path in Download Dialog Box?
You can't. Your question isn't very clear, but I am assuming you mean the download dialog that Internet Explorer displays when downloading a file.
The control is defined by the browser creators and is hard coded. No browser that I am aware of gives any type of access to this control or any way to change it.

How can I upload files asynchronously on ASP.NET?

I've been looking for a way to achieve this behavior and I found this sample project.
The trick in this project is that it changes the form target to an iframe created on the fly.
So far so good, I can get the byte[] on the server-side. But I need to change an image preview after the file is uploaded.
How can I get the iframe to update the main page? Would I have to save it on a file on the disk, make a javascript callback to change the image url? Is there another way to do this? What's recommended?
This control suggested by vorrtex actually causes a full page postback, am I missing something or is it the correct behavior?
I recommend you to use AsyncFileUploader and UpdatePanel. You have to save file on the disk but you can use C# for changing imageUrl.
Add a <script> block to the page that gets loaded in the <iframe> that interacts with the parent page and updates whatever you need to.
You can use the project mentioned below to preview the image before uploading. Working sample is also attached.
http://www.dotnetspider.com/resources/40858-Preview-Image-before-uploading-using.aspx
This uses AjaxControlToolKit's AsyncFileUploadControl and HTTPHandler to upload the image.

Modal that opens an IFRAME (umbraco)

I'v got a problem when opening a Modal window that loads a JFrame.
The file loaded in the JFrame is a aspx file with a tag of /umbraco/controls/Tree/TreeControl.ascx. The modal loads and any text i put in is loaded but the TreeControl will not load. Iv used this ascx file in other places and it works greate if I load it via a normal page call. If you ar not familiar with umbraco Tree. It's basiclly a jquery tree that loads xml nodes.
Tried to copy code here. But couldnt get formatting to work.
Thx for any help
Best Regards
Marthin
This is no longer a problem for me with the new version of Umbraco 4.5

Silverlight getting loaded again and again in Firefox

I am using Silverlight.CreateObject function to create a object tag with a xap which is dynamic i.e. it does it on a click on something. And when u click that back again it gets disappeared. When u click it again, it should show the XAP again without loading it again(as it has been downloaded once).
All works fine in IE. But in Firefox when I click it again, it starts loading it again.
In fiddler it is showing Private Cache for both IE and Firefox.
Can someone help me?
In firefox, when you hide a DOM element that contains a SL app, the SL application is re-initialized. we used jQuery to remove the object tag, then hide the element:
$("#element object").remove();
$("#element").hide();
...before you do show() you have to re-create the SL object tag. above applies also when replacing a DOM element with $.ajax loaded content.
Why are you adding this level of complexity? Why aren't you just setting the visibility style of the HTML DIV or OBJECT tag?
Could you try using the Silverlight.js 2.0 version from Microsoft. That might solve the caching issue?

Categories

Resources