Monday, May 18, 2009

DropDownList Autopostback Problem with Chrome

I was trying to perform Autopostback on Asp.net DropDownList, Selection and found that it was working in IE and Firefox, but not working in Chrome.


Cause of Problem
Required field Validator control is not working as expected for DropDownList Control

Solution to perform Page Postback on making selection to DropDownList
You need to set EnableClientScript="false" in order to make it work in Chrome.

Example:
<asp:DropDownList ID="ddlLanguage" runat="server" TabIndex="1" 
 ToolTip="Select Language" Width="190" AutoPostBack="true" 
 onselectedindexchanged="ddlLanguage_SelectedIndexChanged">
 </asp:DropDownList>

<asp:RequiredFieldValidator ID="rfvLanguage" runat="server" EnableClientScript="false" ControlToValidate="ddlLanguage" InitialValue="0" TabIndex="1" Text="*" ErrorMessage="<b>Please Select Language</b>" Display="None"></asp:RequiredFieldValidator>

3 comments:

Anonymous said...

Thanks it work so good.

Nguyễn Thảo said...

thanks for sharing! :)

Nguyễn Thảo said...

Thanks for sharing! It work good :)

Most Recent Post

Community Updates

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape