In a page there is dropdown list with the name of the
cities like Bangalore,Pune,Chennai,Other and a text box
that would enable the user to enter the name of the city if
other is selected. How to enable validation on the text box
if other is selected

Answer Posted / udai

On_page load
{
RequiredFieldValidator1.Enabled = false;
}

if (DropDownList1.SelectedItem.Text == "Other")
{
RequiredFieldValidator1.Enabled = true;
}
else
{
RequiredFieldValidator1.Enabled = false;
}

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between ispostback and autopostback in asp net?

514


Describe the differences between the lifecycles of Windows services and Standard EXE?

597


What is the difference between application state and caching?

542


What is asp.net futures?

567


What is the purpose of session management?

507






What is page fragment caching?

549


Explain the difference between dataset and datareader.

527


Write a code snippet to implement the indentation in json in web api.

574


What is web router?

498


What is http post and http get?

536


How do I publish my asp.net application to my isp's web server?

581


What is view state management in asp net?

459


What is the difference between system.stringbuilder and system.string

255


What is the life cycle of an asp.net page?

524


What is the current version of asp.net?

493