C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Dropdown autopostback in C#


Posted Date: 13 Aug 2008      Total Responses: 4

Posted By: Kumar       Member Level: Gold     Points: 1



hi all,

in dropdownlist control how to get the results without using Autopostback =true property
for ex ,i have binded empid in the dropdown from database ,when selecting the empid from dropdown the corresponding empname should be bind in the textbox from the database ,how this can be done without refreshing the page .
i have done this ,but for everytime i selecting the dropdown the page is gets refreshed ,

please help me to solve this issue,



Thanx in advance,
kumar





Responses

Author: Danasegarane.A    13 Aug 2008Member Level: DiamondRating:     Points: 3

May be you have to go for Ajax

May be you could try this example


http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx



Thanks and Regards,
Danasegarane Arunachalam



Author: Vishal Prajapati    13 Aug 2008Member Level: SilverRating:     Points: 4

hi

store empid and empname in dataset and with the use of javascript store empname to textbox.

Syntax that works:

returning a DataSet:

for(var i = 0; i < result.tables[0].rows.length; i++)

alert(result.tables[0].rows[i].col_name);

returning a DataTable:

for(var i = 0; i < result.rows.length; i++)

alert(result.rows[i].col_name);



Author: brijesh    13 Aug 2008Member Level: BronzeRating:     Points: 4

hi you can use javascript for this purpose

document.getElementById("ctl00_cphContent_txtHomeUrl").value = document.getElementById('ctl00_cphContent_ddlHomeUrl').value;

by writing a javascript function like this you can bind the employee name in the textbox ,you also have to set DataTextField property of dropdown as empid and DataValueField property as emp name



Author: Geetha    13 Aug 2008Member Level: GoldRating:     Points: 2


Hi

in the combobox selected index change event call a javascript function to bind the selected item to the textbox.

Geetha.



Post Reply
You must Sign In to post a response.
Next : need suggestion reguarding a s/w package done in VB.NET
Previous : connection string
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use