Click here to Skip to main content
12,956,512 members (78,153 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello sir,
I know to create alert box in server side.
public void Messagebox(string message)
        ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + message + "');", true);

but how to create message box with ok cancel or yes no options in web application
in server side?

How to create serverside message box with yes or no options in web application?
Posted 23-Jan-13 20:23pm
Updated 23-Feb-13 3:12am
Do you really know what is HTTP and Web? How server-side? Who will look at this message box? A personal on duty in the server factory? Poor guy may decide to quite drinking if he sees it... :-)
sugunakumaravel 24-Jan-13 3:26am
Hello Sir, I want to show the message box in client side server side one button click want to check one particular condition after that i want to give message box with yes or no options to the client.Please understand my question clearly and asnwer
shabari7 24-Jan-13 23:52pm
better use confirm and if proceed based on ok/cancel, in the client script, reload th e page to trigger the page load event,do the stuff there.

1 solution

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

Solution 1

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>

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;

                   UISettings.ShowMessage("alert alert-success", "Insert Successfully", divMessage, ltlMessage);
               catch (Exception ex)
                   ShowMessage("alert alert-error", ex.InnerException.Message, divMessage, ltlMessage);

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,302
ppolymorphe 2,080
Jochen Arndt 1,973

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2017
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