Adding Images to an ASPX page - c#

I have an aspx page which I am pasting the code from. This page is a preview gallery which when I create a new gallery in my admin panel it auto updates to this page and places the text name I assign in the admin and assigns a page link which takes users to the actual gallery page for that preview... for instance I log in as admin and select manage free gallery.. enter the gallery name (for example" free preview") upload 8 or 9 images and a slideshow then hit submit. The gallery is then created and a link to that gallery is placed on my page for all free galleries. I want to not only have a link but an actual thumbnail image for these.. how would I do this given the code I am pasting below? I would also be willing to just eliminate the text link and go with a clickable thumbnail with a short description under it which actually would probably look better anyway. Pasted ASPX Code follows:
ok so I cant post the code because I am new... any suggestions??? I can email code or post else where if anyone has some help info.
Thanks

How do you create your text link? I assume you're using a asp:Hyperlink control and you're just setting its Text and NavigateUrl properties?
Then you can do the same thing and also set the control's ImageUrl property to the URL path of the image.

Related

Open new page outside masterdetailpage

I just new to Xamarin.Form with Prism. I want to load the page in different behavior. The first one I achieve already is in image below.
But I want to do a behavior like below image. Load a new page outside master detail page. How can I do it in prism?
You have figured out how to display the "Hamburger" icon as well as title by doing the following.
NavigationService.NavigateAsync("MasterPage/NavigationPage/DetailsPage")
If a user makes a selection from the actions listed on the master page. For Example, let's say settings.
You have a couple of options here, you can do navigate relatively
NavigationService.NavigateAsync("Settings")
This will navigate to the settings page. This will also display the back button as the second image. Your current page path will be
MasterPage/NavigationPage/DetailsPage/Settings
Now let's say you want the settings page to be the top details page. You have to navigate to it via an absolute path.
MasterPage/NavigationPage/Settings
NavigationService.NavigateAsync("MasterPage/NavigationPage/Settings")
You need to add a new page to the stack, page over existing one. To do that you should do navigation like this:
navigationService.NavigateAsync("Settings")

how to map image to image button in asp.net with session using c#?

I have an image folder in my project solution. I capture the image for a customer and i keep it in it. After i fill the details I redirect to another aspx page and i take the pic and come back to registration page and map the image to an image button i am using session variable to map the image path which is in the image folder. My problem is I get the same image even if i take a new pic. I am keeping jus one pic at a time in the image folder why do i get the previous image which is not in the image folder. Am i not supposed to get the new pic which i have taken? Please elaborate more on this and provide me a solution..I would be grateful to you..
There could be browser caching at play. One way to get around it is to add a random querystring param to the image url (a timestamp etc) to make the image url unique.
<img src="someImage.png?someParam=1234" />
You cannot delete browsers cache programmatically however below code will help you for disabling caching and clears existing cache from your application... Caching is your problem as you explained in question.
public static void DisablePageCaching()
{
//Used for disabling page caching
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
}

download image that generated from html2canvas on button click

so I have image generated from table using html2canvas.
The output will be placed in canvas.
My problem is what to do when user click "Download Image" button so the image can be downloaded to their computer ?
I already google some way to do it but it all of it are not make sense. There is no code that show how to retrieve the data image and then download it to the computer.
there will be two ways to do this :
still use html2canvas to convert the table to image and then use jquery to download the image
use another solution to convert the table to image and then use c# (code behind) to download it
so which should I do ? or maybe you have any other solution ?
EDIT : I've already got the data url, but I can only send the image to new tab using window.open(image_data_url), not download it. But a minute ago I found the solution. You can just use "a" tag and then add attribute "download=[file_name.jpg]" and fill the "href" value with the data url. But still it's not what I want. If I use this I will need two buttons, button for converting table to image and button for download the image. Is there any possible solution with single click you got the data url and then download it as image ?
EDIT : the solution above can't be used in IE. So maybe there is another solution ?
You can use html2canvas to convert the html element, then save as image on your local using jQuery. Take a look at my sample code :
$("#btnSave").click(function() {
html2canvas($("#map"), {
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
Canvas2Image.saveAsPNG(canvas);
$("#img-out").append(canvas);
// Clean up
//document.body.removeChild(canvas);
}
});
});
here's the real live : http://www.nanonimos.com/drag-pin-ID-convert/
Use toDataURL or toBlob on the canvas and link to the generated url.
When using toBlob you need to use URL.createObjectURL(blob) on it).
Im wondering what version of google you're using since when i google "canvas get image"
I get plenty results with ready to use codesnippets.
Like:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement#Example.3A_Getting_the_data-url_for_a_canvas
or
Can I get image from canvas element and use it in img src tag?

How to navigate to an image from within c#

I was wondering how you, on WP8, can navigate to / open an image?
Suppose I just saved an image to my Save Pictures folder, I now want to navigate the user to that image so they can share it on facebook.
Lets say I have:
MediaLibrary lib = new MediaLibary();
Picture p = library.SavePicture("foo.jpg", imgStream);
How can I navigate to p as if the user had clicked it from the picture library?
A simple method for navigate into image is related to Efficient image manipulation in C#. I think that you need an framework for precessing like AForge.NET.
You could always try passing the url of the image as a string to a page that has nothing on it except an "Image". Then as soon as you navigate to the page you open up the image from the url(url can be for an isolatedstorage file) and set it as the "Image" on the page.

How to set dynamic home page link in image logo?

MySite.com
when I click site logo, wanna appear sitefinity home page. how to set href atrribute in sitefinity as sitefinity CMS is dynamic home page?
there are several ways to achieve this, depending on how you have your logo setup on the page.
Your home page is usually setup to load when you visit the top level domain, which is at the root of your site.
If this is the case and you have your logo defined in a .master page, you can easily set the link to be the root, like
<img />
If, on the otherhand, you have the image on a sitefinity page or template, you need to make sure that you're adding the image inside a ContentBlock, and not the Image widget from the sidebar. This widget is only used to disaply an image, not link one.
by adding the image to the content block, you can then select it and add a link from the radeditor toolbar to the home page (or any other page)
hope this is helfpul!
Another, rather easy way of doing this would be using your url http://www.mysite.com as href for the logo, which is not too bad either (Although not as dynamic anymore)
But still helpful, especially if you are using some code in your print.css that looks like this:
a:link:after,
a:visited:after {
content: " (" attr(href) ") ";
font-size: 90%;
}
and renders href links after your actual links on printed pages.
This would result in something like the below:
[your company logo] http://www.mysite.com

Categories

Resources