Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Client Script
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Client Script
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01317676
Message ID:
01317676
Views:
59
Hi everybody,

I need to be able to dynamically show the message. The code I'm trying to use is
protected void Form_ItemInserting(object sender, FormViewInsertEventArgs e)
    {        
        //make sure username is unique
        if (!Util.IsUsernameUnique((string)e.Values["UserName"], Profile.SiteID))
        {
            e.Cancel = true;
            string Text = ((string)e.Values["UserName"]) + " is already being used. Please try another username";
            string Script = string.Format("document.DisplayMessage(\"{0}\");", Text);
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", Script, true);
        }
The problem is, I believe, with "document.DisplayMessage".

In the ASPX I have at the top:
<head runat="server">
    <title>Registration</title>
    <link href="/asb_includes/AutoSuggestBox.css" rel="stylesheet" type="text/css" />    
    <script type="text/javascript">
    var dv = document.getElementById("spnStatFrame");
    var Spn = document.getElementById("spnStat");
    
    function DisplayMessage(Message)
    {            
        dv.style.display = "inline";        
        Spn.innerHTML = Message;
        setTimeout("dv.style.display = 'none'", 300000);
    }
</script>
</head>
<body>
How can I invoke this script correctly?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform