Click here to Skip to main content
15,925,369 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Back Function. Pin
Brent Lamborn14-Sep-07 11:59
Brent Lamborn14-Sep-07 11:59 
GeneralRe: Back Function. Pin
Saksida Bojan14-Sep-07 12:02
Saksida Bojan14-Sep-07 12:02 
GeneralRe: Back Function. Pin
Brent Lamborn14-Sep-07 16:11
Brent Lamborn14-Sep-07 16:11 
GeneralRe: Back Function. Pin
Saksida Bojan15-Sep-07 7:03
Saksida Bojan15-Sep-07 7:03 
AnswerRe: Back Function. Pin
John-ph14-Sep-07 21:17
John-ph14-Sep-07 21:17 
GeneralRe: Back Function. Pin
Saksida Bojan15-Sep-07 7:04
Saksida Bojan15-Sep-07 7:04 
QuestionIntegrating 2 Data Controls , one as the Control to the Other Pin
ctrlnick14-Sep-07 11:01
ctrlnick14-Sep-07 11:01 
AnswerUsing 2 Data Controls to show related Data Pin
John-ph14-Sep-07 20:41
John-ph14-Sep-07 20:41 
Nikhil Pagidala wrote:
The Category table Contains Category ID and categoryName


Nikhil Pagidala wrote:
ddl_Category.Items.Insert(0,"PleaseSelectACategory");
ddl_Category.Items.Insert(1, "Some1");
ddl_Category.Items.Insert(2, "Some2");
ddl_Category.Items.Insert(3, "Som3");
ddl_Category.Items.Insert(0, "PleaseSelectACategory");
ddl_Category.SelectedIndex = 0;


Didn't you write a method that will fetch the data from the category table and bind to the dropdownlist. something like.... GetAllCategory()


Nikhil Pagidala wrote:
ddl_Category.SelectedIndex = 0;


you don't have to explicitly write a line to set the SelectedIndex property of DropDownList to Zero(0). it set's it by Default.

Nikhil Pagidala wrote:
How can I Relate the Names to their corresponding IDs and then pass the category ID to the GetProductsbycategoryID() function..


set the AutopostBack property of the dropdown list to True

Fetch the Data from the Category table and Bind the CategoryID and CategoryName feild to the DataValueField and DataTextField property of the DropDownList control. try something like this....

DataSet LocalDataSet = new DataSet(); <br />
LocalDataSet = MobjDAL.GetALLCategory(); <br />
ddlCategory.DataValueField = "CategoryID"; <br />
ddlCategory.DataTextField = "CategoryName"; <br />
ddlCategory.DataSource = LocalDataSet; <br />
ddlCategory.DataBind();


then in the selectedIndexChanged Event of the DropDownList try something like this to show the related Data in the GridView...

DataSet LocalDataSet = new DataSet();<br />
LocalDataSet =productsAdapter.GetProductsByCategoryID(ddlCategory.SelectedValue);<br />
GridView1.DataSource = LocalDataSet; <br />
GridView1.DataBind();




Regards
J O H N Rose | [Rose]

"Even eagles need a push." David McNally

Questionwhy to use datasource to gridview? Pin
ss.mmm14-Sep-07 10:28
ss.mmm14-Sep-07 10:28 
AnswerRe: why to use datasource to gridview? Pin
Saksida Bojan14-Sep-07 11:19
Saksida Bojan14-Sep-07 11:19 
AnswerRe: why to use datasource to gridview? Pin
John-ph14-Sep-07 21:02
John-ph14-Sep-07 21:02 
QuestionSession, Cache or Viewstate Pin
ss.mmm14-Sep-07 10:08
ss.mmm14-Sep-07 10:08 
AnswerRe: Session, Cache or Viewstate Pin
N a v a n e e t h14-Sep-07 21:26
N a v a n e e t h14-Sep-07 21:26 
AnswerRe: Session, Cache or Viewstate Pin
John-ph14-Sep-07 23:25
John-ph14-Sep-07 23:25 
QuestionSession timeout doesn't work when sessionState mode is SQL server Pin
vicky45714-Sep-07 9:36
vicky45714-Sep-07 9:36 
AnswerRe: Session timeout doesn't work when sessionState mode is SQL server Pin
N a v a n e e t h14-Sep-07 21:18
N a v a n e e t h14-Sep-07 21:18 
QuestionNameSpace Pin
seemamltn14-Sep-07 8:10
seemamltn14-Sep-07 8:10 
AnswerRe: NameSpace Pin
Saksida Bojan14-Sep-07 9:28
Saksida Bojan14-Sep-07 9:28 
QuestionHow to debugging DLLs solutions Pin
Caio Vitor14-Sep-07 7:45
Caio Vitor14-Sep-07 7:45 
AnswerRe: How to debugging DLLs solutions Pin
Saksida Bojan14-Sep-07 9:45
Saksida Bojan14-Sep-07 9:45 
GeneralRe: How to debugging DLLs solutions Pin
Saksida Bojan14-Sep-07 11:14
Saksida Bojan14-Sep-07 11:14 
AnswerRe: How to debugging DLLs solutions Pin
ctrlnick14-Sep-07 11:07
ctrlnick14-Sep-07 11:07 
QuestionNeural Network? Pin
tanj005614-Sep-07 7:42
tanj005614-Sep-07 7:42 
QuestionHow to pass the gridview datakey to filter a dataset, help pleas Pin
orsini14-Sep-07 7:27
orsini14-Sep-07 7:27 
Questioncheckbox Pin
netJP12L14-Sep-07 7:11
netJP12L14-Sep-07 7:11 

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.