Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
hi
i save my photos in db , and i want set image url from my db to html slider what am i do?
i want , admin can set img src from his control panel or can set it from file that save in db with fileuploader
Posted
Updated 25-Mar-13 6:21am
v3
Comments
joshrduncan2012 25-Mar-13 11:38am    
This isn't a well-formed question.
Sandeep Mewara 25-Mar-13 11:58am    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
mohssenvox 25-Mar-13 12:25pm    
sorry about that...
i want make something for admin of site, and i have htmlslider for change 5 image in header of the site. i want make something that he can upload images and put it for img src of image slider,i think its something like CMS for images.

hi
You must use jquery slides in your project and apply data bound controls(datarepeater or datalist and ...) please google jquery image slider and apply itemtemplate for generating img tag bounded with data source such as database and etc.
it's easy please following under steps:

step1:go to this address and use jquery slider.
http://chocoslider.alandawi.com.ar/index_en.html[^]

step2:instead
HTML
<div id="slider">
	<img src="img/img_1.jpg" alt="" title=""/>
	<img src="img/img_2.jpg" alt="" title=""/>
	<img src="img/img_3.jpg" alt="" title=""/>
	<img src="img/img_4.jpg" alt="" title=""/>
	<img src="img/img_5.jpg" alt="" title=""/>
</div>


use this code:

ASP.NET
<div id="slider">
    <asp:Repeater ID="slider_rep" runat="server">
      <ItemTemplate>
		<img src='<%# Eval("image column name") %>' alt="" title=""/>		
      </ItemTemplate>
    </asp:Repeater>	
</div>	



in your asp page
and set its datasource to database

With best regards.
 
Share this answer
 
v7
Comments
mohssenvox 25-Mar-13 13:35pm    
tnx, but i make slider and i only need to set image src from my db
here is a code:
<div class="art-slider art-slidecontainerheader" data-width="1000" data-height="485">
<div class="art-slider-inner">
<div class="art-slide-item art-slideheader0">
<img src="first1.jpg" height="485" width="1000" />
<div class="art-textblock art-slideheader0-object7998138" data-left="3.17%">
<div class="art-slideheader0-object7998138-text-container">
<div class="art-slideheader0-object7998138-text"></div>
</div>


</div>
</div>
<div class="art-slide-item art-slideheader1">
<img src="i want i can set this src from my db" height="485" width="1000"/>
</div>
<div class="art-slide-item art-slideheader2">
<img src="3.jpg" height="485" width="1000"/>
</div>
<div class="art-slide-item art-slideheader3">
<img src="first4.jpg" height="485" width="1000" />
</div>
<div class="art-slide-item art-slideheader4">
<img src="first3.JPG" height="485" width="1000" />
</div>

</div>
</div>

i do what you say but i cant fix it... :(
Mohammad Zare 25-Mar-13 13:52pm    
Did you defined "art-slide-item art-slideheader1" or "art-slide-item art-slideheader2" and etc in css classes
You can do it through jquery and ajax thing, but if you wan't to make it simpler,

Follow these steps:


1.Make an asp page which returns the image from database based on the id passed to it.

-id can be passed through query string,

-and image is returned by setting the response.contentType="image mime extension"
and passing the image byte[] from the database in response.BinaryWrite()

2.Give the path of the asp page in the imm-src property with the id of the image.

-make the image-id part(where u mention query string) in the url dynamic.


Now admin has to just pass the id's of the images that he wanted to add in the slider.

Try it.

Best Of Luck :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900