How can I cancel OnSelectedIndexChanged ?

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

Hi.
I have a DataGrid with a DropDownList, like this:
<asp:DropDownList id="ddlStatusCode" OnSelectedIndexChanged="SetDirty"
runat="server"></asp:DropDownList>
If the user selects a new value I set a flag on the row in the SetDirty
method so that I know the row has been changed. My problem is that now I
have to change the value of the DropDownList myself using a javascript, but
I don't want the SetDirty method to set a flag on the row. Can I use a
javascript to somehow cancel the OnSelectedIndexChanged event?

Thanks,
Shawn
 
You should then pass another post variable letting your server code know
it was the javascript that changed the value, not the user. Check out Page.RegisterHiddenField
to create a new hidden field for the flag.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Thanks Allen,
I've already solved it by using session to set a new flag, but I was hoping
there was a way to cancel the event without having to set a new flag.

Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top