In the web.config
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
base.Render(writer);
Page.ClientScript.RegisterForEventValidation( cboLookup.ID);
}
*3*, I think is the simplest way, but it does stray from the .Net way of doing things; ah well!
Instead of using
{
base.Render(writer);
Page.ClientScript.RegisterForEventValidation( cboLookup.ID);
}
<asp:DropDownList runat="server" blah blah blah />
use
<select id="ddl1" runat="server" enableviewstate="true"></select>
You may find that you cannot access the 'selectedindex' is not accessible in your 'button_Click' event (or whatever). In order to get your selected value, simply use:
Request.Form[ddl1.UniqueID]
No comments:
Post a Comment