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 3 4209
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 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
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
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com... 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
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
Nope, there's not really since all the server knows is that the posted value
is now different than the previous value.
-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
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:b8**************************@msnews.microsoft .com...
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 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Susan van Houen |
last post by:
Hi All,
How do I intercept an autopostback on the client side
and prevent it from executing the submit?
In classic ASP I used to intercept the on_submit and
just
return false;
|
by: Jon Maz |
last post by:
Hi,
I have a user control which contains a DropDownList, and I want to be able
to set the OnSelectedIndexChanged method of the DDL in the User Control from
the holding aspx page.
Depending on...
|
by: DotNetGruven |
last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each
row. It is a simple On & Off.
When the User Clicks on either of the RadioButtons, I need to postback to
the server and...
|
by: srallen |
last post by:
I have a simple page that has a dropdown with autopostback=true and
onselectedindexchanged is set to a function that never gets called
(checked during debug). This page is subclassed from custom...
|
by: Paul L |
last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a
DropDownList control which is in the ItemTemplate of a DataList.
I have made an exact copy of the DropDownList control,...
|
by: glenn |
last post by:
Hi folks,
I am trying to determine which item in a DropDownList Web control has been
selected.
I have posted an OnSelectedIndexChanged subroutine in my code with a
reference to the subroutine...
|
by: Groove |
last post by:
I have a strange problem. It seems that for some reason, a
OnSelectedIndexChanged event is no producing an error in IE6. What concerns
me is that I just performed that large Windows update a...
|
by: Eraser |
last post by:
Hi to all .NET guru guys...
I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation....
|
by: almisba7 |
last post by:
Hi,
I have a ComboBox that contain ProductIDs and a DataGridView that lists Categories which a product can be a member of. My DataGridView list ALL categories, however, it has a checkbox column that...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |