.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to display MessageBox with 'OkCancel' Button in asp.net

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Hi ,

I need to display a meesage Box with OkCancel button.So when user click "Ok" button I need to do something else nothing.

My web page is with ContentPage without html tag. So i dont know where to place my java script.

But i registered it when page load. When I clicked on the save button the messageBox does not appear and

with error " Expected ';' "

Can someone advise me on this..thanks.

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim script As String = ""
        script = "<script language=javascript id='MessageBox'>" & _
                    "funcion(Save()) " & _
                    "{" & _
                    "if (confirm('Save Record')==true ) " & _

View Complete Post

More Related Resource Links

How to display the edit button etc on the ribbon irrespective of who has checked it out

Is there a way that i can get the edit button etc displayed for all users irrespective of who has checked it out? Actually,i need the ribbon's edit,browse,page publish buttons active on the page even if somebody else has checked it out.I remember seeing an override checkout option available on the ribbon in some other site,But i do not have any such options displayed(I am also logged in and have full permissions).

UpdatePanel, Button and Javascript Messagebox

Hi,  In my VS 2008 C# net web page, I have some TextBoxes and a Button in an UpdatePanel.The Button's click event will do the Update work to SQL Server.The Update is working, but I would like to have a message box popping out if the Update to SQL Server is successful.How do I do that?  " src="http://forums.asp.net/emoticons/emotion-8.gif">Thanks for help. Jason

Displaying a Messagebox with Ok / Cancel button using C# in web application

 Hi all, I would like to get the user's confirmation by displaying a message box with ok cancel options, when you press ok it has to invoke a member function, otherwise other function. thanks. ssm.

how can I display radio button list item


I have a radio button list item on the page.

I want that on the  selection of  the second list item , it will call a javascript function and display another radio button listitem on that page.

Now i can call the javascript function but cant able to make hidden or display of the radio button list item.

I need it using javascript only. 

Display Progress bar after button click in asp.net


When I click Submit button in my Registration form it should be open a (div) progress bar Showing processing....  

how to display a progress bar loading in div after Submit button click??

pla tell me,it's very urgent.

Many Thanks in Advance.


Display progress bar after button click in asp.net


hi friends,

When I click Submit button in my Registration form it should be open a (div) progress bar Showing processing....  and background colour should be changed.


how to display a progress bar loading in div after Submit button click??


plsssssss tell me,it's very urgent.

Many Thanks in Advance.

Display a form as a dialog and then display a messagebox on top


This is the code in my form1

public partial class Form1 : Form
    public Form1()

    private void button1_Click(object sender, EventArgs e)
      using (Form2 dialog = new Form2())
        var result = dialog.ShowDialog(this);
        if (result == System.Windows.Forms.DialogResult.OK)
          MessageBox.Show(this, "Test", "Test Caption", MessageBoxButtons.OK, MessageBoxIcon.Error);

And this is the code in my Form2

public partial class Form2 : Form
    public Form2()

want to open popup screen on button on user control and and display same user control on pop up


Hi i have page where i am calling user control, on user control i want to give button when i click button same user control should appear on popup screen

but not able to do , here code






void Page_PreRender(object sender, EventArgs e)//some value set as hard coded






string defLayer = "1";//Build the params to be passed to gdd xaml file.







defLayer =


Calendar Extender: how to display two months on one button click?



I am asked to popup the calendar with two months. When a user selects a date, it popups in a textbox. The botton I have now may trigger only one calendar, not two. I saw someone asked the same question, but it didn't get solved. I am wondering if anyone may come up with a solution.

I know that I may code myself with two asp:calendar controls and divs, and play show/hide, but that's more work.  

Any suggestion or hint is welcome. Thank you!



javascript display button


I've got a feeling what I'm trying to do here isn't going to be straight forward but I hope it is...

I've currently got a default.aspx page which contains an iframe, has the source set to uploadfile.aspx and its onload event set to hidegif(). In the uploadfile.aspx I've got a fileupload control and a button which has its onclientclick event set to displaygif(). This basically displays an animated gif while the file upload is taking place and hides it again once the upload is complete.

Now the first question is, is there any way to somehow link up the displaygif function to my server side validation so that it only displays the gif if it meets certain requirements, (has a file, jpg format, certain file size etc..), rather than just running the function regardless every time the button is pressed? Does that make sense? Or is the only way to do this by doing the validation in javascript as well? 

And the next question is, I've got another button on default.aspx which is initially hidden, and I want it to be displayed only when the file upload is complete. At first I thought this would just be a simple case of doing the opposite of what I've already done before so just add to the hidegif function in the iframe onload event saying to display the button instead. Obviously I soon

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

A Simple and Extensible Radio Button Style GridView

The GridView is one of the significant controls in ASP.NET 2.0 and later versions. No doubt it reduces a lot of work time. However, customizing the GridView control is not an easy task. For example, it's hard to add a radio button column to the GridView. This article demonstrates the reason why a radio button column cannot act as normal and how to create a simple and extensible radio button GridView.

Display data in gridview dynamicallay

I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information

asp.net display data in gridview

i want to display data in gridview binded to a sql datasource
but the problem part is i want to bind a field of that datasource to a dropdownlist and when a item is selected in that dropdownlist then correcposnding to that data will be displayed in gridview...

display data into GridView from excel sheet

I have to display data from excel sheet into my gridview and also I need to figure out a way to store data into excel files from my web page. I am using C# 3.5, VS 2008.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend