Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i've searched the forum for this, but i only fond how to do the message box, not how to retrieve what button the user pressed...

 

i have an upload button and what i wont to do is if the user try to upload a file that is already there, it ask them if they want to overwrite it. right now it just overwrite it without asking... and is it's possible, if someonme can give me the code in c# code-behind i'd apreaciate ^^

Posted

There's no way for your C# code to detect which button was clicked.

 

I'm guessing that you're going to have to use some more javascript to detect which button was pressed, and then somehow pass that value back to your C# code on the server.

 

Maybe you can have an invisible textbox somewhere, and when when the javascript detects the button, you could put that value into the textbox, and then post the web form. Your C# code could take over from there.

 

Does anyone else have a better way to do it? Somebody please let me know if I'm way off.

 

I hope this helps!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...