Javascrit conformation ok button click event in code behind of c#.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aawhan
    New Member
    • Mar 2008
    • 2

    Javascrit conformation ok button click event in code behind of c#.net

    I have a master page and a content page in my web page(.net 2008).In the master page i am having some menus.Now after doing some operation in the page if i will click to any other menu then it should ask the conformation by javascript.On cancle it should close the window but in case of ok button click it should save the changes.(I mean want to call the save method in that ok button click)

    So can u plz guide me how can i get the event of the javascript conformation ok button click in the c# file.(code behind).Reply me as soon as possible ............... .....



    Thanks
    Aawhan
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    Originally posted by aawhan
    So can u plz guide me how can i get the event of the javascript conformation ok button click in the c# file.(code behind).Reply me as soon as possible

    I am not sure if this is what you are asking. It this a web app, or some sort of C# client GUI?

    If you just want to pick up the onClick event from an HTML button then it would just be something like :

    Code:
    <input type="button" onClick="alert('OnClick Event triggered');" name="Click Me" />
    You would just replace the alert() call with the confirm() or other function call you wanted the even to trigger. Is that what you wanted?

    If you are wanting to pass an event or value from JavaScript to C# I do not think you can without doing an HTTP POST or GET request. JavaScript is a client side language and C# is server side they can not share values directly.

    Comment

    Working...