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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.