When option is selected from dropdown for eg:
i have one dropdown in which two listitem " yes & no"
if yes is selected then fileupload control shown otherwise hide
pn.Own_Land = Convert.ToInt32(ddl.SelectedValue);
7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Mar 17, 2023, 7:00 PM
use this
Tuhin PaulPosted Mar 18, 2023, 1:06 PM
script with some improvements:
Naimish MakwanaPosted Mar 17, 2023, 11:56 AM
Can you inspect the HTML source code of your page in the browser and look for the actual IDs of the FileUpload control.Then, you can update your jQuery code to use the actual IDs instead of the client IDs.
Thanks
Garima BansalPosted Mar 17, 2023, 11:46 AM
Naimish Makwana
Already added jquery library but still not works
Naimish MakwanaPosted Mar 17, 2023, 11:33 AM
Make sure you have included the jQuery library in your ASPX page before your script tag. You can include it by adding the following code in your head section:
Garima BansalPosted Mar 17, 2023, 11:21 AM
Naimish Makwana
I am trying this way but Not working
Naimish MakwanaPosted Mar 17, 2023, 10:59 AM
Hello Garima,
You can achieve this functionality using jQuery. Here is an example:
First, give an ID to your fileupload control, like this:
Then, add a script tag in your ASPX page and write the following jQuery code inside it:
Thanks
Naimis Makwana