If you want to replicate the autopostback behaviour with HtmlSelect, you
need to use some javascript code to cause form submit on onchange event of
the HtmlSelect
Follow the following steps:
To your Form add the following hidden input fields
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
then add this javascript to your page
<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
then in your HtmlSelect element, call the javascript function as follows
onchange="javascript
:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('HtmlSelectID','');"
thts it. This should take care of the postback when you change something in
the select element
Please note that, I havent told you anything new, these are the steps
asp.net follows to generate autopostback for a dropdownlist. Over there
asp.net would take care of generating the javascript code, here you are
simply adding it, since the control is not asp.net server control
Let me know if you need more help
good luck
--
Kumar Reddi
http://kumarreddi.blogspot.com
"00_CuMPe3WaR3D12" <00**************@yahoo.com> wrote in message
news:sJ********************@rogers.com...
I was trying to add the style attributes on DropDownList but I couldn't,
so I found many articles on Google and people saying this is a bug. But in
microsoft support site, I found this:
http://support.microsoft.com/default...;en-us;Q309338
If I use Microsoft's workaround by using HtmlSelect, I lost the ability to
use autopostback. Is there any workaround??
According to microsoft, this is something called "behavior is by
design"... so they are not going to fix it in the next release?
Help...