How to create or use a fancy javascript alert box (or so) that I can use in my ASP.NET web app.?

Hi there;

I use an alert box to inform user for a success act, yet the alert box is so dull.

How to create or use a fancy javascript alert box (or so) that I can use in my ASP.NET web app.?

of course with a minimum coding?

The code that I am using is as:

 function returned() {            
            var value = document.getElementById('<%=UserIDTextBox.ClientID%>').value;
            alert(value + " returned successfully!");
        }

Kind regards.
LVL 12
jazzIIIloveAsked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
check this page : http://www.bitrepository.com/stylish-javascript-dialog-boxes.html

I like this one (the third) because you don't need any other extra plugin : http://www.scriptiny.com/2008/04/custom-javascript-dialog-boxes/
demo here : http://sandbox.scriptiny.com/dialog/dialog_box.html

function returned() {            
            var value = document.getElementById('<%=UserIDTextBox.ClientID%>').value;
            showDialog('Warning',value + " returned successfully!",'warning');;
        }

Open in new window

0
 
jazzIIIloveAuthor Commented:
Hi leakim971;

First, thanks for your way. Very good link.

Amazingly, it's not working and I got the confusion. Please treat the comment as a newbie comment.

Ok, let's go from basics.

1) I am putting the js file to my scripts having the javascript code downloaded from the site.
2) Then in my .aspx file content,  between  <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

 <% string fileName1 = ResolveUrl("~/Scripts/Rebtel_BookShelfWeb.js"); %>
    <script type="text/javascript" src="~/Scripts/Rebtel_BookShelfWeb.js">
        ShowModalDialog('Error', 'You have encountered a critical error.', 'error', 2);
    </script>

</asp:Content>

But I am confused for the following:

This dialog should appear, if the user clicks on the asp:Button named as Insert that inserts the user input ot database, yet, the onclick event of this button is "already" occupied as in "the behind code (aspx.cs)"  the insert operation
takes place.

1) So where to call this javascript function and how?
2) Moreover, is the javascript in the aspx file alright in the header content? Why "not" under the <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">

Hope you can treat this comment in detail.

Kind regards.
0
 
leakim971PluritechnicianCommented:
Hi and Happy New Year jazzIIIlove,

I see ShowModalDialog instead showDialog
Did I miss something?

Best Regards.
0
 
jazzIIIloveAuthor Commented:
Hi leakim971;

I am glad that you enroll my questions :) Yes, happy new year to you too :D

ah, ok, i correct the above function name to showDialog but, still exactly same issue...but if you help on the previous comment, we can resolve this, I am sure.
0
 
leakim971PluritechnicianCommented:
initialy put back your code with the simple alert.
once you've get it working back, post the code, I will help you to integrate the plugin.
Usualy you simply need to replace the window.alert by the new one
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.