Click here to Skip to main content
15,896,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ,
I'm working in Asp.net Application ,I've some problem with DropdownList CSS ,

1) Frist Problem is that When i apply Css to DDL then event not fire on selected index change .

2) When i Enabled Or disabled DDL by click on button then CSS not work . but before its Work.

Please help me some body in seriosly ,who is good In Jquery + CSS
Posted
Comments
ShortProgrammer 24-Oct-13 11:34am    
I've search in google already about its i could not find my problem solution ..

Enable AutoPostBack // choose dropdown list smart tag

or

in property window set AutoPostBack True
 
Share this answer
 
Comments
ShortProgrammer 24-Oct-13 12:00pm    
I'm sorry i've Autopost Back true , Well i give you my code ddl line,
<p>
<label>
Insurance Provider</label>

<asp:DropDownList ID="DrpInsuranceProvider" CssClass="DropDownSlide" AutoPostBack="true" OnSelectedIndexChanged="DrpInsuranceProvider_SelectedIndexChanged" runat="server">


</p>

And aspx.cs code C# on event here
protected void DrpInsuranceProvider_SelectedIndexChanged(object sender, EventArgs e)
{
if (DrpInsuranceProvider.SelectedItem.Text != "Choose One")
{
txtothers.Enabled = false;
}

}
check you page load event.
It may be you have given some code that is responding to client.
If this is the case then your event will not work because its returning back from page_load

for css issue
when you apply disable to any control it adds a class named as "aspNetDisabled" you can view in source(ctrl+u).
If you will apply a class using jquery new class will override the existing style. Here on disable you are applying "aspNetDisabled" class.
To resolve this use style as CssClass="YourClass" and then apply "disable" using javascript not jquery.

Hope this helps!!!
 
Share this answer
 
Comments
ShortProgrammer 25-Oct-13 7:38am    
With I don't want use Java script everywhere :( ,In my application so many time i need disable and enable process .so C# cose is easy for thats, Please give me other idea,Can you tell me that due to update panel This issue can be ???
C For Code!!! 25-Oct-13 8:03am    
Because of update panel this is not occuring as of my knowledge.
I face the same issue in my application there I find solution that I was applying style using class="Myclass" when i was disabling it. It gets overridden by AspnetDisabled class. Then I apply using CssClass="MyClass" It starts working. In your case already you are using CssClass="YourClass" can you send me some more information so that i can debug on my side also
Thanks
ShortProgrammer 25-Oct-13 8:10am    
Well Would you like We skype and share secreen Please. Its will be Easy to help.
C For Code!!! 25-Oct-13 8:15am    
give me your skype id
ShortProgrammer 25-Oct-13 8:16am    
Thanks you ,My skype id tariq.php10
it is happening because your are adding some attribute from server side code to DDL correct me if i am wrong.

if you are doing so please avoid that adding attribute and do it from ASPX page.
 
Share this answer
 
Comments
ShortProgrammer 6-Nov-13 8:51am    
oh i'm doing everything Okay , its problem due to Update panel , if i use update panel then jquery files not work if i not use updatepanle then everything is work good.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900