<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> </form> </body> </html>and in the code changed it to
protected void Form_ItemInserted(object sender, FormViewInsertedEventArgs e) { if (e.Exception == null) { string Text = string.Format("You just inserted {0} {1}", e.Values["FirstName"], e.Values["LastName"]); string Script = string.Format("document.DisplayMessage(\"{0}\");", Text); this.ClientScript.RegisterStartupScript(this.GetType(), "Message", Script); } else { string Text = "The data was entered in an incorrect format, please check it over."; string Script = string.Format("DisplayMessage(\"{0}\");", Text + " " + e.Exception.ToString().Replace(Environment.NewLine, "\\n").Replace("\"", "\\\"")); this.ClientScript.RegisterStartupScript(this.GetType(), "Message", Script); //this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Message", Script, true); e.ExceptionHandled = true; e.KeepInInsertMode = true; } }Now I see the whole messages displayed at the bottom including DisplayMessage(