Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript C#4.0
i have ajaxmodalpopup with some fields.....after inserting record into database....i want one error message that Record inserted suceesfully....
 

please help me
Posted 7-Feb-13 20:51pm
Comments
Avik Ghosh22 at 8-Feb-13 3:23am
   
protected void Button1_Click(object sender, EventArgs e)
{
//your insart transaction part//

Page.RegisterStartupScript("Key", "<script type='text/javascript'>window.onload = function(){alert('inserted suceesfully');return false;}</script>");
}
 

try this...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

First write this code in your .ASPX.
 
<div id="divMessage" runat="server" class="" style="display: none;">
       <asp:Literal runat="server" ID="ltlMessage" Text="test"></asp:Literal>
   </div>
 

Then just write this code behind you .CS page.
 
public static void ShowMessage(string _class, string msg, System.Web.UI.HtmlControls.HtmlGenericControl divMessage, Literal ltlMessage)
       {
           divMessage.Style.Add("display", "block");
           divMessage.Attributes.Add("class", _class);
           ltlMessage.Text = msg;
       }
 
try
               {
                   UISettings.ShowMessage("alert alert-success", "Insert Successfully", divMessage, ltlMessage);
               }
               catch (Exception ex)
               {
                   ShowMessage("alert alert-error", ex.InnerException.Message, divMessage, ltlMessage);
               }
  Permalink  
Comments
Member 9155255 at 1-Mar-13 0:52am
   
Thank u
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

how to get alert message in asp.net[^]
 

or
protected void Button1_Click(object sender, EventArgs e)
    {
        // insert part//
        Page.RegisterStartupScript("Key", "<script type='text/javascript'>window.onload = function(){alert('success');return false;}</script>");
    }
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 499
1 Nirav Prabtani 298
2 OriginalGriff 215
3 _Amy 165
4 Abhinav S 160
0 OriginalGriff 7,715
1 Sergey Alexandrovich Kryukov 6,911
2 Maciej Los 3,954
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100