Click here to Skip to main content
15,914,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Regarding Checkbox Pin
_AK_3-Aug-06 0:26
_AK_3-Aug-06 0:26 
GeneralRe: Regarding Checkbox Pin
ypsyong3-Aug-06 0:33
ypsyong3-Aug-06 0:33 
GeneralRe: Regarding Checkbox Pin
_AK_3-Aug-06 1:13
_AK_3-Aug-06 1:13 
AnswerRe: Regarding Checkbox Pin
Pradipta Basu2-Aug-06 19:00
Pradipta Basu2-Aug-06 19:00 
GeneralRe: Regarding Checkbox Pin
ypsyong2-Aug-06 20:47
ypsyong2-Aug-06 20:47 
AnswerRe: Regarding Checkbox Pin
kiran kumar[Intelligroup]2-Aug-06 20:11
kiran kumar[Intelligroup]2-Aug-06 20:11 
GeneralRe: Regarding Checkbox Pin
ypsyong2-Aug-06 20:49
ypsyong2-Aug-06 20:49 
Questiondilemma Pin
sstcher2-Aug-06 12:45
sstcher2-Aug-06 12:45 
I can not seem to figure out what the problem is with my code. (I
will post after my problem/question). If you perform a search of
categories in Horror, there are 4 titles that appear. I then click
on a title. The details for the title appear. When I perform
another search for a title, actor or director that exists in the
database it will search but the details of the movie I had previewed
stays on the screen. Any help is appreciated. Thanks, Terri Klepzig

Here is my code:
<%@ Page Language="c#" runat="server" debug="true" %>
<%@ Register TagPrefix="Terri" TagName="rColumn" Src="rColumn.ascx" %
>
<%@ Register TagPrefix="Terri" TagName="TopNav" Src="topnav.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

OleDbConnection conn = new OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\\users\\terriklepzig\\wwwroot\\data1\\StudentFB.mdb");
protected void Page_Load(Object Src, EventArgs E)
{
if (!IsPostBack)
{
string loadSQL = "Select * From movies Where New=True";
search(loadSQL);
GetCats();
rptMain.Visible = true;
rptDetail.Visible = false;
}
}
public void GetCats()
{
string catSQL = "SELECT * FROM lookCategory";
OleDbCommand cmdCat = new OleDbCommand(catSQL, conn);
conn.Open();
ddlCat.DataSource = cmdCat.ExecuteReader();
ddlCat.DataTextField = "Category";
ddlCat.DataValueField = "Category";
ddlCat.DataBind();
ddlCat.Items.Insert(0, new ListItem("<-select->", ""));
conn.Close();
}
public void buildCats(Object s, EventArgs e)
{
string SQL1 = "SELECT * FROM movies WHERE Category = '" +
ddlCat.SelectedItem.Value + "'";
lbHeader.Text = "Search: Categories: " +
ddlCat.SelectedItem.Value;
search(SQL1);
}
public void BuildSearch(object sender, EventArgs e)
{
string sqlSearch ="Select * from movies WHERE " +
ddlTAD.SelectedItem.Text + " LIKE '%" + tbSearch.Text + "%'";
lbHeader.Text = "Search: " + ddlTAD.SelectedItem.Text + ": "
+ tbSearch.Text;
search(sqlSearch);
}
public void search(string sSQL)
{
OleDbCommand CmdSch = new OleDbCommand(sSQL, conn);
conn.Open();
rptMain.DataSource = CmdSch.ExecuteReader();
rptMain.DataBind();
conn.Close();
}
public void cmdCheck(object sender, RepeaterCommandEventArgs e)
{
if (e.CommandName == "Details")
{

LinkButton lbtnSelected = new LinkButton();
lbtnSelected.Text = ((LinkButton)
e.CommandSource).Text;
string sTitle = lbtnSelected.Text;
string SQL8 = "SELECT * FROM movies WHERE Title = '"
+ lbtnSelected.Text + "'";
showDetails(sTitle, SQL8);
}
}
public void showDetails(string sTitle, string sSQL)
{
lbHeader.Text = "Details For: " + sTitle;
OleDbCommand cmd8 = new OleDbCommand(sSQL, conn);
conn.Open();
rptDetail.DataSource = cmd8.ExecuteReader();
rptDetail.DataBind();
rptMain.Visible = false;
rptDetail.Visible = true;

conn.Close();
}





<title>Untitled Document





Flashbang Entertainment


<terri:topnav runat="server">

Search -
<asp:dropdownlist id="ddlTAD" runat="server">
<asp:listitem value="Actors">Actors
<asp:listitem value="Director">Director
<asp:listitem
value="title">Title

For



<asp:textbox id="tbSearch" columns="14"
runat="server">
<asp:button id="btSearch" text="Go" runat="server"
onclick="BuildSearch">


Search Categories:
<asp:dropdownlist id="ddlCat"
runat="server">
<asp:button id="btSearchCats" text="Go" runat="server"
onclick="buildCats">



Member Login: (tbUser) (tbPass)
(btLogin)


 


<asp:label
id="lbheader" text="New Movies"
runat="server">




<asp:repeater id="rptMain" runat="server"
onitemcommand="cmdCheck">
<itemtemplate>
<asp:linkbutton commandname="Details"
runat="server" text="<%# DataBinder.Eval
(Container.DataItem, "Title") %>">





 


<asp:repeater runat="server" id="rptDetail">
<itemtemplate>

  
Back 
Title:<%# DataBinder.Eval(Container.DataItem, "Title") %
>
Actors:<%# DataBinder.Eval(Container.DataItem, "Actors") %
>
Director:<%# DataBinder.Eval(Container.DataItem, "Director") %
>
Studio:<%# DataBinder.Eval(Container.DataItem, "Studio") %
>
Format:<%# DataBinder.Eval(Container.DataItem, "Screen") %
>
Sound:<%# DataBinder.Eval(Container.DataItem, "Sound") %
>
Runtime:<%# DataBinder.Eval(Container.DataItem, "Time") %>
Rating:<%# DataBinder.Eval(Container.DataItem, "Rating") %
>
Features:<%# DataBinder.Eval(Container.DataItem, "Features") %
>
Language:<%# DataBinder.Eval(Container.DataItem, "Languages") %
>
Synopsis:<%# DataBinder.Eval
(Container.DataItem, "Synopsis") %>
 

 


 




 

<terri:rcolumn runat="server"> 
Copyright © 2005,
FlashBangEntertainment, All Rights Resrved











 





QuestionFinding the Page Generation Time [modified] Pin
Woad2-Aug-06 12:12
Woad2-Aug-06 12:12 
AnswerRe: Finding the Page Generation Time Pin
Guffa2-Aug-06 13:40
Guffa2-Aug-06 13:40 
GeneralRe: Finding the Page Generation Time Pin
Woad2-Aug-06 13:43
Woad2-Aug-06 13:43 
AnswerRe: Finding the Page Generation Time Pin
kiran kumar[Intelligroup]2-Aug-06 22:22
kiran kumar[Intelligroup]2-Aug-06 22:22 
QuestionAdding Asp.Net file to a normal HTML Site Pin
aseef2-Aug-06 12:11
aseef2-Aug-06 12:11 
AnswerRe: Adding Asp.Net file to a normal HTML Site Pin
minhpc_bk2-Aug-06 15:09
minhpc_bk2-Aug-06 15:09 
GeneralRe: Adding Asp.Net file to a normal HTML Site Pin
aseef2-Aug-06 20:49
aseef2-Aug-06 20:49 
GeneralRe: Adding Asp.Net file to a normal HTML Site Pin
minhpc_bk3-Aug-06 15:56
minhpc_bk3-Aug-06 15:56 
Question"Some of the properties associated with the solution could not be read" Pin
Dpriya2-Aug-06 11:24
Dpriya2-Aug-06 11:24 
AnswerRe: "Some of the properties associated with the solution could not be read" Pin
minhpc_bk2-Aug-06 15:10
minhpc_bk2-Aug-06 15:10 
QuestionASP deploy Pin
-Yoyosh-2-Aug-06 9:39
-Yoyosh-2-Aug-06 9:39 
AnswerRe: ASP deploy Pin
Frank Kerrigan2-Aug-06 10:19
Frank Kerrigan2-Aug-06 10:19 
GeneralRe: ASP deploy Pin
-Yoyosh-2-Aug-06 10:41
-Yoyosh-2-Aug-06 10:41 
QuestionExecuting specific script on another asp.net page Pin
axwiec2-Aug-06 9:25
axwiec2-Aug-06 9:25 
AnswerRe: Executing specific script on another asp.net page Pin
Frank Kerrigan2-Aug-06 10:22
Frank Kerrigan2-Aug-06 10:22 
Questionsimple picture album Pin
Pravin H2-Aug-06 7:14
Pravin H2-Aug-06 7:14 
AnswerRe: simple picture album Pin
Frank Kerrigan2-Aug-06 10:28
Frank Kerrigan2-Aug-06 10:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.