now i want to use asp code to retrive data from a databse .mdb file , im useing this techiniquic below :
<%@ Page Language="VB" %>
<%@ Import Namespace="system.data.oledb" %>
<script runat="server" >
dim varid as long
sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dbconn,dbcomm,dbread,sql
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\database.mdb"))
dbconn.Open()
'Stuny Dwain hewal Where id <> "& varid &"
sql = "select top 5 ID, Header,News,Photo,left(News,160)as Summry,left(Header,55) as S_Header from tbl_News where id not in (select top 1 ID from tbl_News order by id desc) order by id desc "
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()
Last_News.DataSource = dbread
Last_News.DataBind()
dbread.close()
dbconn.close()
end sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Featured Content Slider Using jQuery - Web Developer Plus Demos</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
});
</script>
<%@ Page Language="VB" %>
<%@ Import Namespace="system.data.oledb" %>
<script runat="server" >
dim varid as long
sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dbconn,dbcomm,dbread,sql
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\database.mdb"))
dbconn.Open()
'Stuny Dwain hewal Where id <> "& varid &"
sql = "select top 5 ID, Header,News,Photo,left(News,160)as Summry,left(Header,55) as S_Header from tbl_News where id not in (select top 1 ID from tbl_News order by id desc) order by id desc "
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()
Last_News.DataSource = dbread
Last_News.DataBind()
dbread.close()
dbconn.close()
end sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Featured Content Slider Using jQuery - Web Developer Plus Demos</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
});
</script>
<form id="Form1" runat ="server" >
<!-- First Content -->
<div id="fragment-1" class="ui-tabs-panel" style="">
<asp:repeater id="Last_News" runat="server"><itemtemplate>
<img alt="" src="Images/<%#container.dataitem("Photo") %>
<div class="info" >
<h2><a href="Details.aspx?Jimare=<%#container.dataitem("id") %>&Part=News"><%#container.dataitem("S_header") %></a></h2>
<p><%#container.dataitem("Summary") %>....<a href="Details.aspx?Jimare=<%#container.dataitem("id") %>&Part=news">read more</a></p>
</div> </itemtemplate></asp:repeater>
</div>
</form>
protected void Page_Load(object sender, EventArgs e)
{
var objChild = new { ListID = 1,
Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image1-small.jpg",
ImageURL="http://demo.webdeveloperplus.com/featured-content-slider/images/image1.jpg",
Title="15+ Excellent High Speed Photographs",
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt condimentum lacus. Pellentesque ut diam....",
SubMenu = "SubMenu 0" };
var objChildList = (new[] { objChild }).ToList();
objChildList.Add(new { ListID = 2,
Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image2-small.jpg",
ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image2.jpg",
Title = "20 Beautiful Long Exposure Photographs",
Description="Vestibulum leo quam, accumsan nec porttitor a, euismod ac tortor. Sed ipsum lorem, sagittis non egestas id, suscipit....",
SubMenu = "SubMenu 1" });
objChildList.Add(new { ListID = 3,
Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image3-small.jpg",
ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image3.jpg",
Title = "35 Amazing Logo Designs",
Description = "liquam erat volutpat. Proin id volutpat nisi. Nulla facilisi. Curabitur facilisis sollicitudin ornare....",
SubMenu = "SubMenu 2" });
objChildList.Add(new { ListID = 4,
Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image4-small.jpg",
ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image4.jpg",
Title = "Create a Vintage Photograph in Photoshop",
Description = "Quisque sed orci ut lacus viverra interdum ornare sed est. Donec porta, erat eu retium luctus, leo augue sodales....",
SubMenu = "SubMenu 3" });
header.DataSource = objChildList;
header.DataBind();
content.DataSource = objChildList;
content.DataBind();
}
Thanks & Regards
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
siamand
Member
416 Points
307 Posts
how to interact this jquery with asp.net codes ?
Jun 23, 2011 07:39 AM|LINK
i downloaded the jquery form this link http://webdeveloperplus.com/jquery/featured-content-slider-using-jquery-ui/
now i want to use asp code to retrive data from a databse .mdb file , im useing this techiniquic below :
<%@ Page Language="VB" %> <%@ Import Namespace="system.data.oledb" %> <script runat="server" > dim varid as long sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim dbconn,dbcomm,dbread,sql dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\database.mdb")) dbconn.Open() 'Stuny Dwain hewal Where id <> "& varid &" sql = "select top 5 ID, Header,News,Photo,left(News,160)as Summry,left(Header,55) as S_Header from tbl_News where id not in (select top 1 ID from tbl_News order by id desc) order by id desc " dbcomm = New OleDbCommand(sql, dbconn) dbread = dbcomm.ExecuteReader() Last_News.DataSource = dbread Last_News.DataBind() dbread.close() dbconn.close() end sub </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Featured Content Slider Using jQuery - Web Developer Plus Demos</title> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script> <script type="text/javascript"> $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); }); </script><%@ Page Language="VB" %> <%@ Import Namespace="system.data.oledb" %> <script runat="server" > dim varid as long sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim dbconn,dbcomm,dbread,sql dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\database.mdb")) dbconn.Open() 'Stuny Dwain hewal Where id <> "& varid &" sql = "select top 5 ID, Header,News,Photo,left(News,160)as Summry,left(Header,55) as S_Header from tbl_News where id not in (select top 1 ID from tbl_News order by id desc) order by id desc " dbcomm = New OleDbCommand(sql, dbconn) dbread = dbcomm.ExecuteReader() Last_News.DataSource = dbread Last_News.DataBind() dbread.close() dbconn.close() end sub </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Featured Content Slider Using jQuery - Web Developer Plus Demos</title> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script> <script type="text/javascript"> $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); }); </script> <form id="Form1" runat ="server" > <!-- First Content --> <div id="fragment-1" class="ui-tabs-panel" style=""> <asp:repeater id="Last_News" runat="server"><itemtemplate> <img alt="" src="Images/<%#container.dataitem("Photo") %> <div class="info" > <h2><a href="Details.aspx?Jimare=<%#container.dataitem("id") %>&Part=News"><%#container.dataitem("S_header") %></a></h2> <p><%#container.dataitem("Summary") %>....<a href="Details.aspx?Jimare=<%#container.dataitem("id") %>&Part=news">read more</a></p> </div> </itemtemplate></asp:repeater> </div> </form>asteranup
All-Star
30184 Points
4906 Posts
Re: how to interact this jquery with asp.net codes ?
Jun 23, 2011 09:54 AM|LINK
Hi,
Try this-
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link rel="stylesheet" type="text/css" href="http://demo.webdeveloperplus.com/featured-content-slider/style.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#featured > ul").tabs({ fx: { opacity: "toggle"} }).tabs("rotate", 5000, true); }); </script> </head> <body> <form id="form1" runat="server"> <div id="featured"> <ul class="ui-tabs-nav"> <asp:Repeater ID="header" runat="server"> <ItemTemplate> <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-<%#Eval("ListID") %>"> <img src='<%#Eval("Thumb") %>' alt="" /><span><%#Eval("Title") %></span></a></li> </ItemTemplate> </asp:Repeater> </ul> <asp:Repeater ID="content" runat="server"> <ItemTemplate> <div id="fragment-<%#Eval("ListID") %>" class="ui-tabs-panel" style=""> <img src='<%#Eval("ImageURL") %>' alt="" /> <div class="info"> <h2> <a href="#"><%#Eval("Title") %></a></h2> <p> <%#Eval("Description") %><a href="#">read more</a></p> </div> </div> </ItemTemplate> </asp:Repeater> </div> </form> </body> </html>protected void Page_Load(object sender, EventArgs e) { var objChild = new { ListID = 1, Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image1-small.jpg", ImageURL="http://demo.webdeveloperplus.com/featured-content-slider/images/image1.jpg", Title="15+ Excellent High Speed Photographs", Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt condimentum lacus. Pellentesque ut diam....", SubMenu = "SubMenu 0" }; var objChildList = (new[] { objChild }).ToList(); objChildList.Add(new { ListID = 2, Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image2-small.jpg", ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image2.jpg", Title = "20 Beautiful Long Exposure Photographs", Description="Vestibulum leo quam, accumsan nec porttitor a, euismod ac tortor. Sed ipsum lorem, sagittis non egestas id, suscipit....", SubMenu = "SubMenu 1" }); objChildList.Add(new { ListID = 3, Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image3-small.jpg", ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image3.jpg", Title = "35 Amazing Logo Designs", Description = "liquam erat volutpat. Proin id volutpat nisi. Nulla facilisi. Curabitur facilisis sollicitudin ornare....", SubMenu = "SubMenu 2" }); objChildList.Add(new { ListID = 4, Thumb = "http://demo.webdeveloperplus.com/featured-content-slider/images/image4-small.jpg", ImageURL = "http://demo.webdeveloperplus.com/featured-content-slider/images/image4.jpg", Title = "Create a Vintage Photograph in Photoshop", Description = "Quisque sed orci ut lacus viverra interdum ornare sed est. Donec porta, erat eu retium luctus, leo augue sodales....", SubMenu = "SubMenu 3" }); header.DataSource = objChildList; header.DataBind(); content.DataSource = objChildList; content.DataBind(); }Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
siamand
Member
416 Points
307 Posts
Re: how to interact this jquery with asp.net codes ?
Jun 23, 2011 02:07 PM|LINK
thanks alot for your answer , its working fine ,... but what is the second part of that code you put .. i didn't use it
thanks again
asteranup
All-Star
30184 Points
4906 Posts
Re: how to interact this jquery with asp.net codes ?
Jun 24, 2011 04:12 AM|LINK
Hi,
Second part is some dummy annonimous object data source. You can use any datasource of your choice.
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog