use literal control to create popup alert, execute from code behind

in .net 2.0 , to create a pop up, you may use a literal control from code behind.

 1. put a literal control on page, set its Mode property to "encode" or "Transform"

 2. literal1.visible = false

within button onclick event

 3. literal1.text = "<script>alert('" & YourString & "');</script> "

 4. literal1.visible = true

 

the literal control executes the popup each time the button was clicked.

  

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: beggerking
Posted on: 1/15/2009 at 7:46 AM
Categories: Technical
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading