Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazzIIIlove

ASKER

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.
Hi and Happy New Year jazzIIIlove,

I see ShowModalDialog instead showDialog
Did I miss something?

Best Regards.
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.
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