在下拉列表中应用样式后,OnSelectedIndexChanged无法正常工作 [英] After applying style on dropdown, OnSelectedIndexChanged not working

查看:68
本文介绍了在下拉列表中应用样式后,OnSelectedIndexChanged无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在Asp.net应用程序中工作,我对DropdownList CSS有一些问题,



1)第一个问题是,当我将Css应用于DDL时,事件不会触发选定的索引更改。



2)当我启用或通过单击按钮禁用DDL时,CSS无效。但在工作之前。



请帮我一些精干的身体,谁是好的在Jquery + CSS

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

推荐答案

启用AutoPostBack //选择下拉列表智能标签







属性窗口设置AutoPostBack True
Enable AutoPostBack // choose dropdown list smart tag

or

in property window set AutoPostBack True


检查您的页面加载事件。

您可能已经提供了一些响应客户端的代码。

如果是这种情况那么你的事件将无效,因为它返回 page_load



for css issue

当你对任何人申请禁用控制它添加一个名为 aspNetDisabled 的类,你可以在源代码中查看(ctrl + u)。

如果你将使用jquery应用一个类,新类将覆盖现有的样式。在禁用时,您正在应用 aspNetDisabled 类。

要将此使用样式解析为CssClass = YourClass ,然后应用禁用使用javascript而不是jquery。



希望这有助于!!!
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!!!


它正在发生,因为你正在从服务器端添加一些属性如果我错了,代码到DDL会纠正我。



如果你这样做请避免添加属性并从ASPX页面执行。
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.


这篇关于在下拉列表中应用样式后,OnSelectedIndexChanged无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆