Web Forms :: Showing Images Located Outside The Website?
Dec 22, 2010
I am developing a web app which uses images. Because there are lots of images, I decided to store them in a location out of the web site, maybe they can reside in a different unit (g:Pictures for example, where g: is a drive that belongs to a disk array which is part of the web site infraestructure).
At the beginning, such pictures were saved in a folder within the web site project so it was easy to show them using the asp:image control's ImageURL property but now that they are outside, things get complicated.
I've got a problem with showing images on a page, that i hope someone might help with.
I have two sites like this;
C:WebsitesWebsite - Main Site
C:WebsitesAdmin - Admin site for main site
There is a table in the database that has a link to an image in a folder like this;
C:WebsitesImages - image store
The problem i am having is that when i view the page, the images don't show up. But if connect to the images folder using Windows Explorer then view the page again the images are visible.
Is there a way to have an image store and then all images be availabe to both sites?
I have though about the possibility of using a structure like this; (but i'd rather not)
In my web application I have a separate folder for Images and MasterPages and I am using forms authentication. Thus if I will not allow anonymous access for Images folder the login page will not be able to show any image.
guide me if this is what we should be doing or is there any other way to handle the scenario. Also, let me know is there any drawback of this technique.
I'm trying to show images that come from a sql query into a GridView column, the problem is that the best solution found in the web searches the database twice for each row.
This solution says that we have to first create a handler (ImageHandler.ashx),
It will receive the ID of the row that contains the image, and then query the database with that ID.
Then it will finally perform something like "context.Response.BinaryWrite((byte[])dReader["Photo"]);" (in this case the handler uses a DataReader, I guess we could use another approach)
We also have to declare the image column in the markup as:
The problem is that, the Grid is bound to a SqlDataSource with a SelectCommand like: "Select ID, Name, Photo FROM Employees", that is already querying the database, then the GridView will execute the handler with the ID in it's query string, so the handler will query the database again for the same row, to extract the image.
Isn't there a way to send the image to the handler, so that it only performs the instruction "context.Response.BinaryWrite..." without having to query the database again?
i hv added a treeview control on the .aspx page, when i try to browse it from web server, the image is showing as broken image, where the image link is showing like this [URL]
I am working on URL Rewriting using RegisterRoutes.
its working fine but all css ,js and image not working when i redirect page using URL Rewrite.
my code is in global ascx is below
public static void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapPageRoute("RouteForcategory", "Product/{Cat_Id}/{Cat_Name}", "~/ProductDetailss.aspx"); }
My image path is
<img src="images/logo.png" alt="logo">
But when i run then url and image path looking like below
http://localhost:49936/Product/3/Fruits
And my image path looked
http://localhost:49936/Product/3/images/logo.png
but above is not correct path .
When I redirect page from home page to Productdetailss.aspx then images css, directory root path are changed and its also rewrite. I dont want to rewrite css,js,and image path .
I am also used resloved url code but not working .
i'm trying to show data in gridview through this code but everything appears except the images. I saved the image in sqlserver2005 as Image datatype and when i try to bind the gridview to the db by wizard the images appear when i press test query but nothing when running the app
In Class Named Admin: public DataTable Select_writer(string writer_name)
A user has multiple images which is stored in database(datatype varbinary ).I want to show all the images of that particular user in gridview.Can you people guide me how to achieve this?(Asp.net with c#)
I want to make a website which showing thumbnail images be taken from local folder,say,'thumbnails' inside the root folder like listview items.Below each thumbnails,the name of the file would be displayed with check boxes for selecting any thumbnail images.Clicking on any thumbnails will redirect to another page where the thumbnails and the original image(with the same name in some other local folder say 'Original') would be displayed.
As you can see, i have two choices to go inside the root folder or inside the DHC folder. Both folders should get their images from the IMAGE/ folder inside the root.
My problem is as follows:When i'm in the root part, the images of the masterpage.master are shown, but when i'm in the dhc/ folder part the images of the masterpage.master are not shown.
i am trying to bind image column from database to a control (tried with gridview) to show images in one single row showing 3 images at a time with a scroll bar...can anyone let me know if there is any way of doing this with javascript but not with jquery??
I am using the ajax slideshow which retrives an Image URL from my database table/ It works fine but as soon as I started using the Intelligencia.UrlRewriter, images are not showing. all my code is below.
Code Behind private static DataTable tblData = new DataTable(); string sName = Request.QueryString["Id"]; <query string param is UserId> string strSQL = "SELECT [ImageUrl],[FirstName], [LastName] FROM [Images] WHERE ([FootballerId] = @FootballerId)"; SqlConnection conn = new SqlConnection("Data Source=xxxxxxxxxxxxxxxxxx"); conn.Open(); SqlCommand comm = new SqlCommand(strSQL, conn); comm.Parameters.Add("@FootballerId", SqlDbType.NVarChar).Value = sName; SqlDataAdapter da = new SqlDataAdapter(comm); tblData = new DataTable(); da.Fill(tblData); conn.Close(); // set the initial image if (tblData.Rows.Count > 0) { imgShowImage.ImageUrl = tblData.Rows[0]["ImageUrl"].ToString(); imageLabel1.Text = tblData.Rows[0]["FirstName"].ToString(); } } } [System.Web.Services.WebMethod] [System.Web.Script.Services.ScriptMethod] public static AjaxControlToolkit.Slide[] GetSlides() { AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[tblData.Rows.Count]; for (int i = 0; i < tblData.Rows.Count; i++) { DataRow dr = tblData.Rows[i]; slides[i] = new AjaxControlToolkit.Slide( dr["ImageUrl"].ToString(), dr["FirstName"].ToString(), dr["LastName"].ToString()); } return slides; } ASPX <cc1:SlideShowExtender ID="slideshowextend1" TargetControlID="imgShowImage" SlideShowServiceMethod="GetSlides" AutoPlay="true" ImageDescriptionLabelID="imageLabel1" NextButtonID="nextButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton" PlayButtonID="playButton" Loop="true" runat="server" Enabled="True"> </cc1:SlideShowExtender> <div class="GridRight"> <asp:Image ID="imgShowImage" runat="server" Height="300px" ImageAlign="Middle" /> </div> SQL Database Path /Footballer/sandra//Horses.jpg Web Config <rewriter> <rewrite url="~/Sandra" to="~/CMC/PublicProfile.aspx?Id=dff12c6b-e37c-4591-97ae-a65c27c1de1d"/> </rewriter> rewriter>
I recently learnt of a method to display binary images, from a sql table, that requires that the image's ImageUrl be a url of a second page with a querystring value. For example, if I have two pages, Page1 and Page2, If my image is on Page1, the imageUrl would be something like page2.aspx?ImgID= ImageID(The Querystring value passed to Page2 from Page1) . This method displays the image perfectly in the local host but then only the red X icon, that replaces a missing image, shows up when I run my application online.
Why are the images not displaying and how may I correct this? I have my codes below.
Image on Page1:
[Code]....
And this code displays the image on page1 but is the same on page2:
this is probably something really simple but I cant see what! Any images I have in a masterpage aint showing in child pages, all i get is the box with the red cross in it. Dont think Ive done anything different from usual and its not something thats happened in other sites so im kinda scratchin my head with it.
I have a website using Telerik controls for ASP.NET. When an AJAX request starts, the Loading Panel (defined in the master page) will display, with a loading image, text, and faded white background color. It works totally fine in Firefox and Chrome, but the background image and text don't display in IE8. All that displays is the white background.LoadingPanel code: Loading ideas why IE8 isn't displaying the images? I've inspected the page source, and they're there in the CSS.
i added one treeview control in aspx page .All parent and child nodes are working perfect in this aspx page.
Now this same code i pasted in an ascx page and that ascx page i called through DNN website.That time parent node display is coming properly,but when i click on the parent node child nodes are not showing up?
I am having an issue with images not showing in Chrome or FireFox. In chrome i get this message in the Console "Not allowed to load local resource.". The images appear fine and correct in IE11 & MS Edge. I'm assuming this is some king of security problem I need to address, but am not at all sure what.
i have designed a website in that i have image tool but the image must change dynamically the changes is made in admin page.. by which tool we cn obtain that......
I would like to create a website which shows an image and it disappears and then another images appears which then dissappers and another is shown...can someone point me in the right direction for this please?