Click here to Skip to main content
13,194,662 members (69,550 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I would like to display the data that is relevant to the item clicked in the dropdownlist using C#.For Example,I have a dropdownlist items like General comments and Comments.The page looks like as shown below.On selecting the Comments item in the dropdownlist,The cursor need to points the Comments(Need to works like a WORD.)

General comments:

Don't ask "I need to write a booking application". Specify exactly what it is you need help with.

Keep the question as concise as possible. If you have to include code, include the smallest snippet of code you can - do not dump your entire codebase.
Posted 26-Dec-12 7:42am
priya9826 26-Dec-12 14:12pm
Is it possible to do it in either javascript,jquery,or css?
ryanb31 26-Dec-12 14:20pm
The title seems easy enough but the description is quite confusing. What exactly do you want?
HashamAhmad 26-Dec-12 14:27pm
i think you are talking about scrolling the page on clicking an item from the dropdown menu. Am i right??

if yes then you need to place labels on your html page using #[labelname] then redirect it to the same page by appending the label
priya9826 27-Dec-12 9:18am
Will you Please send sample code.How to do that?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

it can be accomplished using jquery.

//get all products from DB and save them
  ProductList = new ProductsBLL().GetAllProductsList();

  this.ddl.DataValueField = "Id";
  this.ddl.DataTextField = "ProductName";
  this.ddl.DataSource = ProductList;

and the jquery

$('#Main_ddl').change(function () {

now, where I have used alert, you can use ajax call to go with your further code or to build a logic.

priya9826 27-Dec-12 11:54am
How to use ajax call()?
Faisalabadians 27-Dec-12 12:41pm
HI PRIYA, u can use ajax call with this

type: "POST",
url: "PageName.aspx/MethodName",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Do something interesting here.

for complete example,

about Ajax call
priya9826 31-Dec-12 12:52pm
Thanks for helping.I have a static data on the page.On click of dropdownlist item,How to scroll the page to particular label?
Faisalabadians 29-Mar-13 5:23am
first you have to determine the current location of the each lable, then you can use scrollTo() java script method. let me know if you have any query about that.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171018.2 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100