JQuery not working in IE - c#

I am using the Tiny slideshow in my asp.net page. It works fine in all the Browser and here is the LINK, But my problem starts when I include that page in my master page and display the same. the Jquery stop working in Internet explorer.
http://www.spareach.com/public/xtemp8.aspx?userid=22&AspxAutoDetectCookieSupport=1
I am tired a lot for this.
Can any one help me please.

your script interpreted by ASP.NET Session. the actual URL of file is http://www.spareach.com/lightbox3/script.js. if you put the absolute URL then they work fine. hope this helpful

If you include that in another page, your relative link to the .js file is going to be invalid. So, your options are to make it absolute (http://www.something.com/folder/tiny.js) or to include the .js from the head or common document, if you use that structure.

Related

Cannot load photo locally in ASP.NET MVC

So, i am creating an ASP.NET(MVC5) application, on which i want to show an image using an img tag like that:
<img src='#Url.Content(Path.Combine(Server.MapPath("~/Products-Data"), product.Name, product.ThumbnailImage))' />
The problem is that no browser actually load the image. The fun thing is that the link generated by the razor engine is valid, and i can see the image if i open it from another browser tab. After some searching i noticed that in the chrome console, there was this error:
I found a lot of topics regarding this error(change settings in web.config, use the --allow-file-access-from-files flag and e.t.c), but none of these actually worked. This is going to be a real-world application ... but for the time being i need to test it locally, and check if everything works properly. Any work around's here folks ?
You just need to generate the path using relative path, resolving it to the absolute path wouldn't work, as it will be the path of the server's particular drive location which is most of the times outside of the working directory of the web application and it is not possible for the browser to fetch the resource using physical path, so it wouldn't work for you.
You would need to do do it something like :
<img src="#Url.Content(String.Format("~/Products-Data/{0}/{1}", product.Name, product.ThumbnailImage))" />
and it would be more better if you pass it via Model object the relative path and the view just have displaying code, view should not contain logic to generate the path.
Hope it helps you!

Layout Page not rendering Some Pages Asp.net MVC5

i am trying to develop MVC5 applicaiton. i am facing a problem. i have set a layout page placed in shared folder. Home pages of all controls are working properly.
but other pages are not showing in proper way.
I have attached a sample page Details
I checked css is also showing in source but page is not displaying in proper way
Thanks in advance. i am new in MVC
If you open your browser's Developer Toolbar and review the network tab you should be able to see if your pages are returning 404 for the files. When your browser is open press F12 and the toolbars should open.
It looks to me like your references to your local/application based stylesheets/javascript are missing the tilde symbol ~ at the beginning which means in ASP.NET the server-side application root.
For example ~/Content/bootstrap.css would be translated to the URL of the bootstrap.css file that's in the application's root.
You can drag and drop the bootstrap.css file in your content file into the _layout.cshtml file to see the correct path for the href attribute.
Put the sympole ~ before the link of css path

how to be redirected to the previous page using response.redirect() in asp.net c#

Right now i have a folder with another folder inside of it. The two folder names are called "pc details" and "pchardwaredetails"
When on a page in "pchardwaredetails" i want to return to a page in "pc details" using a button and response.redirect() but the file paths are just getting too complicated for me. What might the file path be from a page called "Details" in "pchardwaredetails" to a page called "viewMore" in "pc details"?
Also please feel free to explain how paths work so i know for future
thanks
Usually the Referrer of the page (a HTTP header), tells you what page you've come from so to go back you should just be able to do:
Response.Redirect(Request.UrlReferrer.ToString());
That's assuming you came from PC Details. However if you land on PC Hardware Details from some other page then that won't work, you would have to hard code the back feature.
You can simplify ASP.NET paths and use ~, for example:
Response.Redirect("~/some/path/pc_details.aspx");

CSS template not working with Login.aspx page

I've finished building my ASP.NET website. I downloaded many templates for the design, I applied them to the master page, and they worked fine for my pages.But "Login.aspx" and "ChangePassword.aspx" and "ChangePasswordSuccess.aspx" and "Register.aspx" which are built in with the website don't apply the templates!
They are not applying the new look only, They worked fine with the default style
Can any one help me with this, I don't understand the problem.
Thanks.
try to write the path of the css file with ~ or with ../
ex:
href="~/Styles/Site.css"
href="../Styles/Site.css"

how to download the image which will be displayed after a cache image on the web page?

I want to download an image from a cartoon website. and my app is WinForm,not WebForm.
So let's say that there is an image on the a.html.
Normally, when I click the previous page and am redirected to this page,
there will be a image :"image is loading",let's say A.jpg, in the same block.
After 5 seconds, the real one,let's say B.jpg, will be displayed.
So what I got is only the caching image rather than the one,B.jpg, which I want.
So..... how should I do it?
Thanks in advance.
ps: I have posted this qustion for more than 48 hours, and only got a few of answers which don't solve my problem.
I am wondering that why there are only 2 people posted their answers?
Is my question not clear?
If any, please let me know.
Thanks
EDIT: Original answer removed since I misunderstood the question entirely.
What you want to do is basically HTML scraping: using the actual html of the page to discover where files are hosted and download them. Because I'm not sure if there are any legal reasons that would prevent you from downloading the image files in this manner, I'm just going to outline an approach to doing this and not provide any working samples or anything. In other words, use this information at your own risk.
Using fiddler2 in Firefox, you should be able to find the domain and full url that one of the images is downloaded from. Basically just start fiddler2, navigate to the site in firefox, and then look for the biggest file that is downloaded. That will tell you exactly where the image is coming from.
Next, take a look at the HTML source code for the page you are viewing. The way this particular site works, it looks like it hides the previous/next downloads in a swf or something, but you can find the urls in the javascript for the page. Look for a javascript array called picArr.
To download these using a WinForms app, I would use the WebRequest object. Create a request for each image url and save the response to disk.

Categories

Resources