How to bring confirm box in asp.net.Please Help

  • Thread starter Thread starter pargat singh
  • Start date Start date
P

pargat singh

Hi Everyone,


I have two listboxes and one Datagrid.On first listbox
SelectedIndexChanged i am populating Datagrid.when i select
value from second listbox, on SelectedIndexChanged of this listbox i
want to display comfirm box saying that "Are you sure you want to
rebind datagrid." with yes no button. Exmple on first listbox i select
deptno 10 and it bind all emp from deptno 10 to datagrid.when i select
20 from second listbox i want confirm box before i bind emp from
deptno 20 to datagrid.

Can anyone provide some sample code.

Thanks,
 
Add an attribute to your second listbox like so:

listbox2.Attributes.Add("onchange","return confirm('Are you sure you want to
rebind datagrid?');")

-Stanley
 
Hello Pargat

http://aspnet.4guysfromrolla.com/articles/021104-1.asp

This includes a sample project you can analyze

HTH
Tim Stal

----- pargat singh wrote: ----

Hi Everyone


I have two listboxes and one Datagrid.On first listbo
SelectedIndexChanged i am populating Datagrid.when i select
value from second listbox, on SelectedIndexChanged of this listbox
want to display comfirm box saying that "Are you sure you want t
rebind datagrid." with yes no button. Exmple on first listbox i selec
deptno 10 and it bind all emp from deptno 10 to datagrid.when i selec
20 from second listbox i want confirm box before i bind emp fro
deptno 20 to datagrid

Can anyone provide some sample code

Thanks
 
How can i capture ok or cancel response as it is on client side.

JavaScript. The confirm(message) function creates a dialogue box with the
message passed, and an OK and Cancel button. it returns true or false
depending upon which button whas clicked.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Because it is on client side how i will take action according to
OK/Cancel.e.g if og rebind data otherwise no.How i will know which
button was pressed when i am on server side.

Thanks
 
Back
Top