Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi,
 
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.
 
Comments:
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 8:42am
Comments
priya9826 at 26-Dec-12 14:12pm
   
Is it possible to do it in either javascript,jquery,or css?
ryanb31 at 26-Dec-12 14:20pm
   
The title seems easy enough but the description is quite confusing. What exactly do you want?
priya9826 at 27-Dec-12 9:18am
   
Will you Please send sample code.How to do that?

1 solution

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

Solution 1

Hi,
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;
  this.ddl.DataBind();
 
and the jquery
 
$('#Main_ddl').change(function () {
            alert($('#Main_ddl').val());
        });
 
now, where I have used alert, you can use ajax call to go with your further code or to build a logic.
 
thanks
  Permalink  
v2
Comments
priya9826 at 27-Dec-12 11:54am
   
How to use ajax call()?
Faisalabadians at 27-Dec-12 12:41pm
   
HI PRIYA, u can use ajax call with this
 
$.ajax({
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,
 
http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
 
about Ajax call
http://api.jquery.com/jQuery.post/
priya9826 at 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 at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 29 Mar 2013
Copyright © CodeProject, 1999-2014
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