3 Replies - 3654 Views - Last Post: 24 May 2009 - 02:39 PM Rate Topic: -----

#1 DeCompile  Icon User is offline

  • D.I.C Regular

Reputation: 19
  • View blog
  • Posts: 301
  • Joined: 20-July 08

Messagebox Popup... ?

Posted 24 May 2009 - 02:52 AM

Is there an easy way to create a popup window using ASP.Net?

Something like if a user was going to delete data, just a simple ASP.Net version of a messagebox to check if they really wanted to delete that data or not.
Is This A Good Question/Topic? 0
  • +

Replies To: Messagebox Popup... ?

#2 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5346
  • View blog
  • Posts: 27,298
  • Joined: 10-May 07

Re: Messagebox Popup... ?

Posted 24 May 2009 - 03:01 AM

Message Boxes are usually generated in Javascript, since they will execute on the clients browser. Myself, I would use it that way, & based on yes or no, parse the result back to the server. That way you only have the server traffic for yes, rather than parsing the results through asp, to determine the answer.
Was This Post Helpful? 0
  • +
  • -

#3 DeCompile  Icon User is offline

  • D.I.C Regular

Reputation: 19
  • View blog
  • Posts: 301
  • Joined: 20-July 08

Re: Messagebox Popup... ?

Posted 24 May 2009 - 02:24 PM

Yeah, I knew that it could be completed in Javascript.

I just thought there may have been some syntax that I was missing that would let me do something similar.

:)
Was This Post Helpful? 0
  • +
  • -

#4 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Re: Messagebox Popup... ?

Posted 24 May 2009 - 02:39 PM

hello,

client side script is more convenient to me too.

so by using javascript
you maybe can try window.showModalDialog() Method

or you can simulate the message box by interrupting the current procedure flow.

for example:
say you have a function called "dosomething"
1- inside that function add a new function to be called when some one click on one of the message box buttons (test for example)
this.test=function(btn){
// add what you want to do when a message box button clicked
// if(btn==){do something}
}


2-call a function that will generate the message box you need(msg for example)
pass that function a text to display and a function reference to call when you click on some buttons on the message box
function msg(resfunc,txt){
msg.resfunc=resfunc
msg.txt=txt

// do something with txt and call msg.resfunc whenever you want to call back the response function (test)



note: you have to declare the response function (test) before you call the message box function (msg)

anyways, this is just an idea, and i don't expect to fit your needs.
so, if it doesn't work for you, go back the the ordinary message box
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1