.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Display the image in the aspx page

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net


     I am fetching the image from the sqlserver and display the
     image to aspx page in thumbnail.

   I wrote the code as follows
          SqlConnection connection = new SqlConnection("server=Ns;initial catalog=MR;uid=sa;pwd=`kk");
                SqlCommand command = new SqlCommand("select ID, Image from tblPlanogram where id=" + imageid, connection);
                SqlDataReader dr = command.ExecuteReader();
                while ((dr.Read()))

View Complete Post

More Related Resource Links

CreatePage.aspx cannot display page layout preview image


I am using a custom site template and functions fine, except that when I get to the CreatePage.aspx page, the preview image is not displayed. When I looked up the properties on that image, it was looking for the image in a location other than the place where it should.

For eg: Instead of looking for it at /_catalogs/masterpage/en-US/Preview%20Images/ArticleBodyOnly.png  it looks for it at xxx/test/_catalogs/masterpage/en-US/Preview%20Images/ArticleBodyOnly.png where xxx was an external consultant that worked on this site before me and I am new to sharepoint. The only scenario when this doesnt happen is for the DefaultPageLayout.png file.

This problem seems to repeat everytime I use this site template. When I open up the sites with these templates on Sharepoint Designer, I can see all the preview images over there. For some reason, the CreatePage.aspx is not looking for the images in this location and looks for it at another location.

I am really stuck with this issue, can someone please help me understand why this is happening or help me resolve this?


jpg files will not display in gridview on aspx page

I have an image object in a template of a gridview The datasource of the image object evaluates to the path of the jpg file. However, the aspx page displays a little red x instead of the picture. How do I get the image to display/Frank learning vs 2005

image is showing in sql image viewer,but in aspx page it is not getting

dears , in sql 2005 table i created an image columnin that image colum i inserted an image in hex format. data like as follows.0xFFD8FFE00104A4649460110010100FFDB0430C88A88CAAACCCE101C121010101022181A141C28222A28262226262C303E342C2E3A2E2626364A363A40424646462A344C524C44503E444642FFDB0431CCC10E1020121220422C262C4242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242FFC401F001511111100000000123456789ABFFC40B5100213324355440017D12304115122131416135161722711432813FA182342B1C11552D1F0243362723F9A161718191AD25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3FA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC401F103111111111000000123456789ABFFC40B5110212443475440127701231145213161241517617113223281814423FA1B1C19233352F0156272D1A162434E125F11718191A262728292A35363738393A434445464748494A535455565758595A636465666768696A7374D75767778797A3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3F3FA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFC0011807803F3121021113111FFDD0402FFDA0C31021131103F0A6B1D43F3A42B0E03FED3F3F63FFD0685A5DB5216176D1B69058FFD15DB46DA80DB49B6811FFFD24D3F3F2A434AD46C9408FFFD38D52A511D21D3F8E97CBA763FFD43F651B2A4A176D1B698FFD53F6D1B6A61B28D94058FFD63F65

How do I display my animated image while the next page loads?

I have the following code so it'll show an animated progress GIF but if the site takes longer than this, it will quit. Is there a more effective way?System.Threading.Thread.Sleep(2000) Here's my update progress code:<asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <div class="PleaseWait"> Please wait ... </div> </ProgressTemplate> </asp:UpdateProgress>  

display links to attachements in allitems.aspx page


I have a custom list and this list support attchements. I need to display the list of attachment for a items in the allitems.aspx page. Currently it display an icon (clip icon) when the items have attchements associated with it. but i need to display the links to the attchements so that users can directly click and go to the attchement with out going to the dispForm.aspx. can any one help me on this? i have searched for this but i could not find any solution.

Display image on the bottom of last page


In our current project we decided to use MS Reporting Services to display reports and export to PDF.
After solving many problems (btw. terrible product, who invented that data item can not be used in page header???) one left:
client requirement is to put image (bank transfer form screen - about 10 cm height) on the bottom of last page - reporting services don't have 'report footer' - how can I achive this? There is a way to dynamic (code?) change page footer height and show image only in last page 'anchored' to bottom?

Display progress image when page is loading using jquery


hi friends,

When I click Submit button in my Registration form it should be open a (div) progress bar Showing processing.... (or) loading  and block background.


how to display a progress bar loading.... in div after Submit button click??


plsssssss tell me,it's very urgent.

Many Thanks in Advance.

How to display power point in an aspx page, HOW?


How can one allow a power point presentation to be displayed on an aspx page?

Or do I have to embed it after I load it up on scibd, I much prefer a within site approach rather than embedding, how this done ??

Accross browsers as well: IE, Firefox, Google etc

Display image from remote server on asp.net page.


I have a webform that I will use SQL Stored procedure to return a path to an image on a remote server.  I need to display that image on my webpage.  I have been reading for 2 days now and have found nothing on loading images from a server.  Something like this \\ServerName\K:\LFCMBS2008\K2008\K20081\00\00\00\00000001.tif.  Is this not possible, or have I just been googleing the wrong things "ASP.net Display image from server"?  My server contains literally millions of images that I need to use on my site.  Please advise.

Display a Web Page as an Image in Form


Hi All,

I'm not sure if this is even possible so I need to ask the forum for guidance.

If I have a C# ASP.NET Web Application form, how can I display a web page as an Image?


What I am doing is creating an app that will send out dynamic emails by giving the User a choice of what goes into the email to be sent.

So from the top working down the form I have Labels and Text boxes to enter recipients name, company, account #, and email address. Then some image buttons for Cancel and Send. Then an area for the selections to be made for the email content, and at the bottom is the same row of image buttons for Cancel and Send.

What I want to do is use the URL stored in the database of the email (which is out there as a web page) and somehow display it across from the selections to be made. The area is about 4 inches wide by 6 inches tall.

So can I make an Image out of it for display OR is there a way to shrink it to fit the area?

I have been searching Google but cannot find what I am looking for, so any samples would be greatly appreciated.

BTW, I cannot just screen scrape an turn it into an Image as there will constantly be new emails created all the time.

Launch CMD File From ASPX Page


My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.


We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.


Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.

Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



Can't display an image from the database



My database has a products table that has images stored in a varbinary(MAX) column.

I'm trying to display product information in a repeater and trying to display the images as well by using a GenericHandler class but I can't get the image to show up in my page.

Here is my Handler.ashx class:

Public Class Handler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        '== Set up the response settings
        context.Response.ContentType = "image/gif"
        context.Response.BufferOutput = False

        Dim id As Integer = -1
        Dim stream As Stream = Nothing
        If Not String.IsNullOrEmpty(context.Request.QueryString("id")) Then
            id = context.Request.QueryString("id")
            stream = GetImage(id)
        End If

        Const buffersize As Integer = 1024 * 16
        Dim buffer(buffersize) As Byte
        'byte[] buffer = new byte[buffersize];
        Dim count As Integer = stream.Read(buffer, 0, buffersize)

        While count > 0
            context.Response.OutputStream.Write(buffer, 0, count)
            count = stream.Read(buffer, 0, buffersize)
        End While


Session problem with display of image in row of reportviewer


Hello techies...

I am new to this sql reporting service. But anyhow by surfing I am able to bind the report but i was stuck in image display.

Anyways, i also managed that. But the real problem is whenever i was keeping a image control in rdlc report i was having session prob. If i remove the image control then as usual report works fine.

Please suggest me some solution.... either for session problem or for image display. I am keeping the image name in database but for binding the rdlc report i am using a store procedure which return the path (static) concating with the image name(kept in database).

Hope to find a solution .....

Cannot Display Image in Report


 I have a report using an image control that needs to display an image inside subfolder "Images\InstitutionLogos\".

On properties of image control i have the following properties set:

MIMEType= "image/png"

Source      = Database

Value        ="\Images\InstitutionLogos\" +Fields!InstitutionID.Value+".png"

Inside subfolder "Images\InstitutionLogos\" each image is named with a number which represents Fields!InstitutionID.,(ex, 1.png, 2.png, 10.png)

However, when i run the report the image just displays an X, what am i missing?

Integrating aspx page in classic asp web application



I have a classic asp web  application. I am trying to add an aspx(C#) page to the existing asp application.

The existing asp pages have include pages for header and footer. How to add the classic asp include files in aspx page.

Also, How to deploy the aspx page in the existing classic asp web application.

Thank you

Want to create Page URL rewrite based on Users GUID and Display name?



I am using the asp.net membership. 

On my site I have a Profile.aspx page.

In the code behind of this page,  i get the logged in UserId (Guid) and pass

this to a method in my DAL. GetUserByUserId()


In my database I have a Table called Member which the method gets the data from

and displays details on the page about  the user.


What I want to happen is when they have logged in and are diverted to Profile.aspx,

the page URL shows www.MyWebSite/Profile/UsersName 

for example



is this possible. In my Member table I have FirstName and LastName columns or do I get the

name from the membership table.


even better would be they go straight to www.MyWebsite/JohnSmith.aspx


thank you for any help






ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend