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:
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
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
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
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
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
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
Sep 23, 2010
Crystal Reports Toolbar Images not displaying in the production server.
View 3 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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