Asp.Net MVC3 Upload a new logo for page - asp.net-mvc-3

In the application I'm working on I need to be able to upload a new logo for the site from a settings page. As of now the code replaces the logo-file on disk, but the redirect to the same settings page still shows the old image. Although after a refresh of the page I get the correct image.
I would like the Redirect to load the new image.
I've set these values for the ImageHeaders:
response.Cache.SetCacheability(HttpCacheability.Public);
response.Cache.SetExpires(Cache.NoAbsoluteExpiration);
response.Cache.SetLastModified(File.GetLastWriteTime(FileName));
Are there some sort of "stronger" redirect, or some other way to make this possible?

Related

Maintaining image preview in Netlify CMS

When uploading an image in Netlify CMS, I get a preview image, which however disappears right after a refresh. The image I attached shows the source attribute the preview element uses - it looks like the logic here assumes that the image is already deployed to the same domain (which in turn assumes that the site the CMS manages lives on the same domain as the CMS interface itself). Is there a way to change the base URL just for the preview, e.g. to some kind of https://rawgit/...-like URL. I am looking for a setting that affects only the preview widget behavior and nothing else (where the image is saved, what URL path it adds in the post frontmatter etc).
Thanks in advance for any pointers!

Wrong OG image when sharing to Facebook despite FB Debugger displaying correctly

I just added an OpenGraph image to a site I'm working on and using the FB Debugger the info retrieves the correct image, however when sharing the url I still see default images being displayed (there was no specified OG image before). Is there something I'm missing here? The site uses a custom Python based framework and image is served via gzip from an Amazon EC2 instance, if that would affect the output in any way.
The problem is not with your website.
Facebook takes some time to refresh images inside facebook.com even though you can see the changes on Facebook Debug Tool.
In order to view your new image inside Facebook you can do two things:
Manipulate a little the URL you are trying to share, this way
Facebook will fetch the open graph data again.
Just give it some
time, it will be refreshed after a few hours.
There are three way to change your image you need to clear the
1) Manually clear facebook catch using the https://developers.facebook.com/tools/debug/ facebook tool
2) Add version code end of the url like ?v=1
3) write the GraphAPI code from when you click on the share button it will clear the facebook page cache.

asp.net mvc3 formauthentication,custom role provider-Jquery auto load tabs not working..

I am creating dynamically loading tabs using jquery Ui tabs in my ASP.NET mvc3 project.
Here i have a product page. The product page contains left menus like Customer,Address,Contact,etc..
Here my process is when i click one my left menus, the tab created dynamically with Grid records.
And,
I'm creating a custom role provider and I set a Authorize attribute specifying a role in my controller and it's working just fine, like this:
[Authorize(Roles="SuperAdmin")]
public class SuperAdminController : Controller
...
If one user doens't have access to this controller, And click one of my left menu means,
he's redirected to login page. Its also working fine.
The problem is after the user logged in it didn't redirect the proper page in tab content area.
If my problem not understandable means please let me know..
Thanks Advance...
If you carefully check the URL in the browser, you will see that the URL does not change when you load something by Ajax. That is the point of Ajax actually, you do not load the whole page, right?
Now as the state is not saved when you try to load the content using Ajax, your redirect URL is only the page you loaded initially. That is why you cannot go back to the tab you wanted to load.

How to capture screen application to .jpg and post it on wall

now i'm making application for facebook with javascript.but I don't know method to change my screen application to .jpg file.
So,I would like to know how to change my application and post it
Thank you for your help.
You cannot get the screenshot done client side, however you can grab the HTML code of the page being viewed and AJAX it up to your server, have your server component transform that HTML into an image.
Use this to get the HTML content of the page at the moment they want the screen capture document.getElementsByTagName('html')[0].innerHTML;
AJAX the HTML to your server
Have your server transform that HTML into an image (depending upon server-side technology you're using, there are solutions to this) (eg http://www.converthtmltoimage.com/)
two choice, store the image on your server to be the permanent place sending back the new URL for the image, or send the content back to the client.
Have the client HTTP Post the image content to Facebook for the post, or reference the URL
It's a big project, but I commend you for tackling something like this.

Loading both random and specific content in WordPress with Ajax, sometimes changing the URL path

I have a site running on WordPress with a custom post type called "Video". By defaults in the front page displays a random video and when the video ends, the page is reloaded and it displays another random one. The URL remains intact, save obviously when one use a permalink for an specific video. I want to tweak the site to use Ajax, yet I'm not sure of how to acomplish it well:
By default, the main page should display a random video and when it ends or when one reload the page (via a link in the site itself), it displays another random one, yet with ajax. The URL on the navigator don't change.
When one clicks the permalink of a video (attached to each random video), the URL on the navigator has to change but the page remains the same and when the video ends, it just loops (much like how it works right now, but without reloading the whole page).
HTML5 History API with hashbang (#!) URLs fallback

Resources