Message box on client side using class library of .NET
hi to all,
can any one of u solve my problem.
How can i show a message box on client side using class library of .NET it may be vb.net or c#.net.
if any1 has any idea about it. please let me know.
I have written the code that but it is giving the message boxes on server side only.
You cannot use a server side script to create a message box because that is done client side as you know. There is no real interaction between the server and the client (it would be a huge security problem if there were), your only option is to dynamically write out the java script that will open a box, and write out its contents dynamically too.
One trick i use is to simulate a dialog box using a panel and server side controls. I do this in a user control and add it to any page I will need to use it. I always make sure that the page contents are in a table, panel or div that I can set it's visible property to false then I set the visible property of my user control dialog box to true. The OK and Cancel buttons of my dialog box reverses the visible properties.
I actually created several user controls to simulate some standard dialog boxes but you could use one with appropriate properties to set it's behaviour at runtime.
Some of the properties you'd like want are to specify the icon, the buttons (yes/no, OK/Concel, OK only, etc.) and also allow a text input field like the inputbox does.