I need to implement a custom print preview screen for one of the pages in my MVC web project. I was just wondering what some of the recommended ways of doing it are. Basically, we have a dropdown menu with a bunch of different options-- each one displays a different statistical report under the dropdown menu. For the print preview, I only want to preview the report, not the whole page.
Should I simply take the html and cut off the stuff I don't want, and re-render it? Or create some kind of other document, XPS maybe, and display it as that? Alternate CSS maybe?
Not that anyone is probably interested, but I ended up just using the HTML from the original page and disabling/restyling all of the links and stuff, and hid unnecessary elements via javascript.
Related
I need some advice on what route to go with.
I'm using the jquery plugin galleriffic (image gallery), and I want to add a few galleries for a number of subjects that the user can choose from using AJAX.
My questions:
Should I make one gallery and change the list content?
Or just put all the lists on the page and just "show" them when the subject is pressed by the user?
If changing the content of a list is the better way, should I use javascript to do that or use ASP.NET (c#)?
I should add that the content of a list holds a lot of images for each subject.
Any advice will be great -- I'm pretty much a beginner.
I'd go with multiple galleries that you can toggle using Javascript. You may want to have each of these inside an IFRAME in case gallerific cant handle multiple instances of itself. Then toggle the IFRAME on and off using buttons on the main page.
This is probably the quickest way to get you up and running with most re-usability, you'll get a chance to learn Javascript by the simple fact you'll be implementing gallerific with a .NET backend and have to custom-build the navigation, but wont have to go into the 'deep end' by trying to clean up and re-use the same gallery.
Basically, you load each gallery as the user clicks on it on the main page. Each IFRAME contains 1 gallery with all images for that gallery (unless you have hundreds in which case you want to use paging with 100 thumbnail images per page), all IFRAMES are running concurrently but only 1 is displayed.
Try getting 1 gallery up and running connected to your .NET backend first, then do the navigation later by passing a parameter into the IFRAME src as like this: mygallery.aspx?name=travel_pics.
When the user clicks a button in my C# app I want to show him bunch of images so that he can pick one. I don't want to do it with file browser, I want him to be able to view little thumbnails of the images so that he sees what he is picking.
Is there any control I can use to do this?
Thanks
If you are refering to a WinForms control, I would recommend the free ImageListView control.
Works very well in my own real-world projects. Plus, the author is very responsive and the control seems to have a very high overall code and design quality.
You will need to create custom code. Or you can use a WYSIWYG Editor.
Here are 2 popular ones for .NET.
http://www.tinymce.com/
http://ckeditor.com/
Create multiple PictureBox-es in a grid formation in the form that you are creating.
Display one thumbnail in each PictureBox.
I am usually against PictureBox control usage, but in this case, you can't miss.
I am using a picture box in my C# application, I want it to cover a certain portion of the web browser (the username part on youtube).
I have a 21.5" monitor and this is what it looks like to me:
But then this is what it looks like to one of my users with a 24" monitor:
As you can see the position of the picture box has moved up due to that persons screen size (I believe)
Is there a way to make sure that it will always be over that section of the web browser or moving it to that section of the web browser?
Thanks.
I am convinced your approach is wrong and would break anytime either for screen resolution or size changes, or for using the mouse-wheel to zoom in/out the page or whatever. it is just unreliable and patching this by overlapping another UI control like a picture box or a panel on top of what you want to hide is simply insecure and unreliable.
I think the tow real options you have are these:
You try to interpret the page content and remove from the page's DOM the information you do not want to show to the user (eventually HTML Agility Pack could help for this DOM parsing and manipulation but I am not sure if you can read what the WebBrowser control is showing and inject changes into it);
use the YouTube APIs and Tools - .NET APIs to load the videos and details you want to load and show but rendering this information with your specific UI elements in your windows forms application, without using a browser to show the normal YouTube site.
Probably the second option takes more work but is more secure, I am not sure 100%, as I said, if the first option is viable at all. You could search for HTML Agility Pack and web browser control to see if anybody has done this before already :)
I am developing asp.net with c#web application.
I want to have a control in ASP.net that has text formatting controls as well as a ruler to edit the text which i enter in text area. It would be great if i can open Msword in a web browser without Save buttons at the client side.The data must be saved into the database.
The control should be similar to the one which i get while writing this question.and also e.g gmail compose mail.
My main aim is to provide right and left indentation to the text that is being entered and i want to preview on A4 size paper.
Please guide me someone the way to proceed.I got Htmleditor ajax control but it doesnot have a ruler.
You may take a look at WMD (this is what you are using for typing this question). You could also take a look at the many other alternative editors and pick one that suits your needs.
For an application i'm developing as my first c# project, i'd like to be able to print information from the application in a similar style as the 'card style' printing option that's available in outlook.
I've created a User control that is layed out the way i'd like to print it and am able to add that control as often as needed to a form in the two column layout that i want, but so far haven't found a working tutorial/example explaining how to print the contents of the form including the visual elements (adding page breaks, without breaking the layout of the user control).
Any advice or pointers in the right direction would be appreciated.