Sql Server 2008 - Repeater Control For Displaying Images And Associated Names?

Oct 24, 2010

I want to implement an image gallery in asp.net/C#. I am using sql server 2008, visual studio 2010 and .NET 4.0.

I have made a webpage and now want to display 6 images as thumbnails (and their names just below the thumbnails) at the center of the page. The format of the display is something like this:

[Code]....


Basic operation is like this:

I pull images from a database and then display them as above as thumbnails. The 1 2 3 Next> are links depending on whether there are more than 6 images pulled from the DB. So basically the numbering 1 2 3 4 Next> is dynamic depending on how many images exist. Can anyone give me a basic overview of how this an be achieved? Should I be using a asp:Repeater or a asp:DataList for this kind of a display?

View 1 Replies


Similar Messages:

Web Forms :: 2008 - Upload Images To Server (application / Images Folder) And Retrieve (display)

Apr 17, 2010

how to upload images to server(application/images folder) and retrive(display) from and on client PC for asp.net. its just for uplaoding logo directly to server folder and retriving from server to client. i am not getting server path on client pc for image.

View 5 Replies

DataSource Controls :: Saving Images To A Server Folder With Different Category Names And The Path To A Database?

Jan 19, 2010

Here is what I am basically trying to accomplish I want to upload images to the server separated into categories and save the file path into the database. I have found plenty of documentation on saving to a file and the file path to a database. But, I haven't found anything that will allow me to seperate the images into categoies.

I have made three tables in the database

[code]....

What I am trying to do is create a gallery for our clients to browse and download different vesions of posters and ad cards.

View 15 Replies

AJAX :: Images Of Rating Control Is Not Displaying?

Mar 17, 2011

I am using a Ajax Rating Control in Web User Control(".ascx").

The Images used for this control is not displaying in the browser, even though the control is getting loaded.

When i use the same code in the Aspx page it is working fine. It is only problem in Web User Control.

View 1 Replies

VS 2012 - Loading Images Into Repeater Control

Aug 19, 2013

I'm creating a simple CMS for a fairly simple web page. I'm currently working on a part for displaying news on the main page.

The controls I have on the page:

- a GridView control with enabled pagging and a SELECT button,
- an Image control for displaying news cover picture,
- CKeditor control for editing news text,
- Repeater control for displaying pictures from database

How does it all work?

In Page_load I have the following:

vb.net Code:
connectionString = "Data Source=KORISNIK-PCSQLEXPRESS;Initial Catalog=****;
User ID=**;Password=****"        conn = New SqlConnection(connectionString)       
If conn.State = ConnectionState.Closed Or conn.State = ConnectionState.Broken Then             
Try                conn.Open()                If Not IsPostBack Then                    bindGrid()                   

[Code] ...

As you can see, I load the GridView control with news from DB. At this moment all other control are disabled. User has to SELECT the row he wants to edit, and click the MODIFY button.

This is what happens when user clicks the MODIFY button:

vb.net Code:
Private Function selectForEdit()        dsSelectForEdit = New DataSet       
captionPicture.ImageUrl = ""         enableCommands()       
Dim sqlQuery As String        
sqlQuery = "SELECT news.newsCaption, news.newsIntro, news.newsCoverPicture, news.newsStatus,

[Code] ....

Basically, I select newsDetails based on newsID. Also, this is where I take the coverPicture from the database using a generic handler.

This is the code for showImage.ashx:

vb.net Code:
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest        
Dim newsID As Int32        If Not context.Request.QueryString("newsID") Is Nothing Then           
newsID = Convert.ToInt32(context.Request.QueryString("newsID"))        Else           
Throw New ArgumentException("No parameter specified")        End If        

[Code] ....

This part works fine, as the picture is correctly displayed in the Image control. Now, I also want to load the pictures that are related to the selected news. So, I use this function:

vb.net Code:
Private Function selectNewsPictures()        dsSelectPicturesForEdit = New DataSet         enableCommands()       
Dim sqlQuery As String         sqlQuery = "SELECT newsDetailsPictureID,newsDetailsPicture,newsDetailsPictureCaption,newsDetailsPictureDescription FROM newsDetailsPictures WHERE newsID = @newsIDEditing"          myCommand = New SqlCommand(sqlQuery, conn)         myCommand.Parameters.Add("@newsIDEditing", SqlDbType.Int, 250)       

[Code] ....

You can see that I take pictureID's and store them into a List (of integer). That way I can use those integers in showNewsPictures.ashx to display all the pictures.

showNewsPictures.ashx:

vb.net Code:
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest        
Dim newsID As Int32        If Not context.Request.QueryString("pictureID") Is Nothing Then           
newsID = Convert.ToInt32(context.Request.QueryString("pictureID"))        Else           
Throw New ArgumentException("No parameter specified")        End If        

[Code] ....

The picture ID's are being sent through pictureRepeater_ItemDataBound:

vb.net Code:
Private Sub pictureRepeater_ItemDataBound(sender As Object, e As RepeaterItemEventArgs)
Handles pictureRepeater.ItemDataBound        
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then            
Dim ctrl As New Image            ctrl = e.Item.FindControl("pictureHolder")           
ctrl.Width = 100            ctrl.Height = 100              ctrl.ImageUrl = "~/showNewsPictures.ashx?pictureID=" &
listOfIDs.Item(itemIndex)            itemIndex = itemIndex + 1         End If    End Sub

THE PROBLEM:

I load the page, select the news, click the MODIFY button and all works well. The news details are loaded, the cover picture is loaded, the repeater pictures are loaded.

I click the cancel button (clears all the commands and disables them) and I get an error saying the DataReader needs to be closed.And I never use one This happens either in showNewsPictures.ashx or showImage.ashx.

In some other scenario, this happens right after I click the MODIFY button.

View 1 Replies

Web Forms :: Displaying Images With Consistent Size Using Image Control?

Aug 3, 2010

How can I display photogarphs in an image control so that they are all the same size for an online catalogue without distorting the actual image.

I have taken the photos with a digital camera, loaded them in to Photoshop, cropped the image and finally resized the images to an acceptable size (while constraning proportions to avoid image distorsion).

The problem is that the images all have different height dimensions as while resizing i was able to choose the width that I wanted but as I had to constrain proportions to avoid distorsion, it caused the heights of the images to differ.

On my web form I have an image control that is set to the same width as the images but as the heights of the images differ from one and other, it is impossible for me to set a fixed height that will prevent some of the images being distorted when displayed in the image control.

View 3 Replies

Data Controls :: Displaying Records Horizontally In Repeater Control

Jun 3, 2013

I want to limit the records to 18 in every line,  then the next records goes to the nextline?

<asp:Repeater id="Repeater2" runat="server" >
<HeaderTemplate >
<table border="1" width="100px">
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="litRowStart" runat="server"></asp:Literal>

[code]....

View 1 Replies

Crystal Reports :: Toolbar Images Not Displaying In Production Server

Sep 23, 2010

Crystal Reports Toolbar Images not displaying in the production server.

View 3 Replies

Forms Data Controls :: Displaying Images Retrieved From SQL Server In A GridView?

Mar 22, 2010

I'm trying to display images retreived from a sql server table in a GridView.

I found that the approach generally accepted was to have a handler that finally writes the image to the HttpContext.

My problem is that I only get a red X in the image column and not the images I want.

I'm using Northwind database, and I'm displaying data from the Employee table.

[Code]....

View 8 Replies

Forms Data Controls :: Displaying Formatted Text (rtf), Ideally In Repeater Control?

Jun 1, 2010

I have a section of a page with a repeater control on it, taking information from a database, to display the latest information available to users. However it would be preferable to be able to format this information, so that it can have line returns, bold and underline in it. Rather than just single line plain text.

What is the best way to accomplish this? At the moment this is what I have: [Code]....

View 6 Replies

Forms Data Controls :: Dynamically Bind Images To Repeater Control From Different Folders?

Jun 23, 2010

I have tried binding images to repeater from one folder called images . But now, I am trying to bind the repeater with different folder's images, based on which menu item is clicked like "Wedding", "Birthday". When "Wedding" is clicked then it repeater should be loaded from Wedding folder's images similarly with "Birthday".

Currently i am using following code to load from single folder.

if
{
Repeater1.DataSource = di.GetFiles();
Repeater1.DataBind();
(!IsPostBack)string imgDir = Server.MapPath("~/images");DirectoryInfo di = new DirectoryInfo(imgDir);

[Code]....

View 3 Replies

VS 2008 Placing Data In Repeater Control?

Mar 30, 2011

This is my first time using the repeater control. I found some examples and to place a value in a label, I am doing the following:

Code:

<asp:Label ID="lblLocation" runat="server" Text=<%#Container.DataItem("City")%> ></asp:Label>

What I want to do is write the City and State to the single label control. When I put both in there for the lblLocation it fails. I would prefer to combine them rather than add another label control.

View 3 Replies

Web Forms :: Implement One More Repeater Control Inside Existing Repeater Control (Nested Repeater)

Feb 3, 2014

I am using a repeater control and i want to use one more repeater control inside the existing repeater control . 

Like this:

<asp:Repeater ID="Repeater1" runat="server">    <HeaderTemplate> </HeaderTemplate>       
<ItemTemplate>
<!-- start child repeater -->     Here I want to use one repater control      <!-- end child repeater -->
</ItemTemplate>
</asp:Repeater>

View 1 Replies

DataSource Controls :: Storing And Comparing Images In SQL Server 2008

Apr 10, 2010

I am trying to build a small e-commerce website that will allow user to upload and store the image of their product in the database and also the user could upload the image of the product and compare it with all the similar product images that are already stored in the database. I am using MS ASP.Net using VB.Net as the front end.

if MS SQL server is the best option to carry out such task or should I consider some other database to do this in terms of complexity involved as well as the integration with MS .Net framework.

View 1 Replies

Displaying Names Starting With Those Initial Characters?

Jun 24, 2010

I am working on ASP.NET 2.0, I have a list of books Name in my master table, while entering new book name in Textbox I want to display the book names starting with those initial characters. How to achieve this.AJAX, silver light.Etc.google like feature..

View 5 Replies

Javascript - Finding Images Names From Index.aspx.cs Files Which Are Stored In Hidden Fields?

Nov 10, 2010

I used the script where the image array has static images.I want to convert it dynamically by finding my images names from index.aspx.cs files which are stored in hidden fields.

my hiddenfileds has value:

uploads/../uploads/M_Banner_3-JO633939707781250000.jpg;uploads/../uploads/M_Banner_4-JO634014944056581250.jpg;uploads/../uploads/M_Banner_2-I-85634067544720151968.jpg;uploads/../uploads/M_Banner_1-Plan634067543966714468.jpg

I want to split this hidden filed and assign it to imagearray.how can i do this

var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [568, 313], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/1.jpg", "", "", ""],
["images/2.jpg", "", "", ""],
["images/3.jpg"],
["images/4.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})

View 2 Replies

Web Forms :: Looking For Rft Server Control not HTML Based Server Controls To Display And Store Text As Well As Images?

Feb 14, 2011

I need rft server control not HTML based server controls to display and store text as well as images, from which i can get rtf text and can save it as it is in DB.

View 1 Replies

VS 2008 Allow Users To Download Files That Have Names Containing & Characters

Jun 18, 2010

I want to allow users to download files that have names containing & characters.

We've escaped our way through the problem but cannot seem to get around one last obstacle.

Here in Download.asp.vb we have

Code:

[code]....

View 9 Replies

Visual Studio :: 2008 - Set Two Dataset Names For A Table In Its Property?

Sep 14, 2010

i need to prepare a report as a table. but my table needs to contain data from two schemas. so my doubt is, is it possible to set two dataset names for a table in its property?

View 3 Replies

VS 2008 Gridview - Hide Certain Columns And Change Column Names

Jun 15, 2012

I have a gridview that I am loading from a stored procedure. I need to be able to hide certain columns and change the column names. Since it is loading with stored procedure the columns aren't listed in the gridview->edit columns properties.

View 1 Replies

Web Forms :: User Control Not Displaying In Server?

Jul 9, 2010

i have designed a usercontrol (ascx) and it was ran on local machine, i have uploaded that into the server after that its not displaying on the aspx pages, i have uploaded all the images, scripts, aspx, ascx, dll but i dont know why its not displaying?

View 8 Replies

.net - C# - Displaying Server Control Based On How Many Items Are In A Datalist?

Oct 26, 2010

What I'm trying to do is on page load display either of two controls based on how many items are in a datalist. For instance, if the datalist only contains 1 item I want it to display

Literal1.Visible = true;

If there is more than 1 item in the datalist, show

LiteralMulti.Visible = true;

Anyone know how to do this?

View 2 Replies

How To Add Images To The Repeater

Feb 10, 2011

I want to display images by using repeater control. those images have to change with respect each 5seconds. how to change those images? those images should be in database? i kept images in my project folder. then now how to go further.

View 1 Replies

Images Not Displaying In Browser?

Apr 3, 2010

i placed an image control in my aspx page and asssigned an url to it,but the thing gets worse,that image is not displaying in browser.

View 3 Replies

Displaying Images From Database

Apr 11, 2010

I have a datalist where i am displaying an image using the following:

<asp:Image ID="prodimage"
Width="200" Height="150"
ImageUrl='<%# (DataBinder.Eval(Container.DataItem, "vcimagelocation")) %>'
Runat="server"
CssClass="aspImage"/>

but i want to do the following as i am implementing the zoom functionality. How have another field in my database which is vcimagelocationsmall which will go in img src. But how can i do the following in .net using my image locations?

<a href="demoimg/kawasakigreen.jpg" class="jqzoom" style="" title="Kawasaki Green" name="demo1"><img src="demoimg/kawasakigreen_small.jpg" title="Kawasaki Green" style="border: 1px solid #666;"></a>cheerstj

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved