How to get the return value from confirm message box?

In this case, I have a radiobuttonlist control, if the user changed the radiobuttonlist's index, then the application will be prompted a confirm message box.  If use click the "OK", then proceed, otherwise, remain unchanged.

I tried to write the code under the event (radiobuttonlist_SelectedIndexChanged):

radiobuttonlist_SelectedIndexChanged (Byval sender as object, Byval e as Eventargs)
response.write("<script lang=javascript>confirm('Confirm to proceed!')</script>")
textbox1.visible = True

However, no matter what the user chosen, the textbox1 is always appeared. Actually, if the user selected "OK", then textbox1 is visible, otherwise, it is invisible. Can I get the response what button is the user selected?
Alternatively, I tried the other code under the event (Page_Load):

Page_Load
radiobuttonlist.attributes.add("onclick", "return confirm('Confirm to proceed!')")

However, this time, the application is prompted the confirm message box twice which I clicked the radiobuttonlist. The postback of radiobuttonlist is set to True.
Can anyone help me to solve this problem?
Thanks in advance.
0
epjames
11/9/2004 4:20:57 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

0 Replies
1369 Views

Similar Articles

[PageSpeed] 14

Reply:

Similar Artilces:

return value from confirm message box
I haved searched on this forum but was unable to find anything. I am using the following code: Me.btnSubmit.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');") While this code works, I would like to be about to retrieve the true or false from the button click so I can do something else if the user clicks the "Cancel" button. Incidently, is it possible to change the confirm message box to use the "Yes / No" instead of the default "OK / Cancel" And I'd like to thank my brain, for without it, no...

showing a window.confirm message and get its return value
Hi,I am having a web page in which there is a textbox and a button.The Button is a web server control and it is used to create servers.A server is nothing but a folder which is created in the web server root and it contains several files.Now the code for the "Create Server" button is as follows:private string DoCreate()    {                string strpath;        string status;        txtbox1val = TextBox1.Text.Trim().ToString().ToUpper();        strpath = Server.MapPath(Req...

How to get return from confirm message box when text change event
 hi all,i need to use confim message box to get response when the text change event.and i need to use that response in code behind.please send me answer qiuck.thanks See the example in this link : http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.interaction.msgbox(VS.80).aspx   You can do something like this  Dim msg As String Dim title As String Dim style As MsgBoxStyle Dim response As MsgBoxResult msg = "Do you want to continue?" ' Define message. style = MsgBoxStyle.DefaultButton2 Or _ MsgBoxStyle.Critical Or MsgBoxStyle.YesNo ...

Capture return value of javascript confirm message in VB.NET
Capture return value of javascript confirm message in VB.NET I was trying to use javascript to capture return value of confirm message box at codebehind using hidden HTML input box. function getMessage() { var ans; ans=window.confirm('Is it your confirmation.....?'); if (ans==true) { document.Form1.hdnbox.value='Yes'; document.Form1.textbox1.value = 'test'; } else { document.Form1.hdnbox.value='No';} } To retrieve the value in .aspx form I am using following code on button click Private Sub Button4_Click(ByVal sender As System.O...

How to get return value from confirm box when SelectedIndexChange event of dropdown list
 hi all, i have use dropdown list and i need to get user responce for change the selected item in drop dow list.therefor i need to use confirm box to get his or she responce.i was use confirm box and try to get responce but its not work.please tel me any one knew it .thanks Harsha u can use javascript to achieve this ddlist.Attributes.Add("onchange","javascript:return check();");  function check() { var r=confirm("r u sure u want to change");if (r==true) {return true; } else {return false; } }happy codingLive and Let Live ...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

getting values from a web form to windows form
Hot Requirement ..... Is there any possible of getting values from a web form to windows form ????? Yes One way i to use the WebRequest and WebResponse classes of the System.Net namespace. For example:  WebRequest request = WebRequest.Create("URL of the web page); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string content = reader.ReadLine(); ....    Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way fut...

confirm message box with yes/no, plus other controls value in the message
I have 2 issues: --I need to show a confirmation message box with yes/no, but it only shows OK and Cancel.  See code below. Is it possible to show yes/no? and if so, how? --The other issue is I need to show the message with the value of other control in the message, but can the code below works with other controls named inside of the message? and if so, how? For example:  the message would show something like:  are you sure you want to update and override [dropdownlist.selectedvalue here] and [textbox.text here]? any idea/help would be really appreciated. I'm ...

Load Text box of one web form with selected list item of list box of another web form
one help please Problem is i have two web forms  1.  ForiegnkeyTest.aspx  2. foroginkeytable.aspx   step 1 1 ForiegnkeyTest.aspx one web form <head runat="server"><script language="javascript" type="text/javascript">   function popWin()   {         var confirmWin = null;      confirmWin = window.open('foroginkeytable.aspx','anycontent',   'width=455,height=435,status');   }  </script> &...

How can I open a .Net web applicaiton from a web service page and return values
 Hi allhere is what I need from an Oracle jdeveloper form, click on a button, open a web application in .Net, let the user choose several options and calculate a Total Amount, return the total amount to the jdeveloper application,could it be done with a web service?the Oracle jdeveloper form calls a web service that opens my .Net  web applicationmy web application returns a Total Amount value, my web service returns the Total Amountthe jdeveloper form gets the Total Amountthanksjsn     jsn1:  Hi all here is what I need  from an Oracle jdeve...

Get message that mozilla has to close. Get booted out of web site. Get message from Mozilla to report problem. Problem reporting will not work. Eventually I delete the report message.
Name: Linnea Hagberg Email: lhagbergatsmithcovedotcom Product: Mozilla Suite Summary: Get message that mozilla has to close. Get booted out of web site. Get message from Mozilla to report problem. Problem reporting will not work. Eventually I delete the report message. Comments: See above. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 ...

Message Boxes and Web Forms
When I go to display a MsgBox(".... in my web form I get an error. Is it possible to display simple pop up messages while working with the web forms?If you don't live for something, you'll DIE for nothing!!!!!! Hi, Message Boxes are not available in asp.net. You need to write custom javascript functionality for popping up messages. Herebelow is one example:- Response.Write("<script>alert('Hello');</script>") ; Thanks.regards,Harishhttp://geekswithblogs.net/ranganh...

Web Forms Message Box
Hello, I am converting an old VB 6.0 application into a web based app with VB.NET and ASP.NET. The problem that I am having is that the old application made extensive use of popup boxes and message boxes that would ask the user a couple questions and then pass the values back to the main form and close the popup box. I have not been able to find a good way to do this using web forms. Does anyone have any suggestions on this? Thanks Torrey You will have to use vbscript or javascript to display message boxes on the client side. You can use something like this: Button1.Attr...

Passing Values from a Web Form to Another Web Form
Hello All! I am trying to pass values from one web form to another web form. I know that there are 3 ways of doing this: queryString, Server.Transfer and Session. I am using the Server.Transfer method. But I am not able to create, in my 2nd web form, an instance of my 1st web form. My 1st Web form is named CallTrack.aspx and my 2nd is named Export.aspx. What I mean is something like this: Public value as CallTrack. I can't create it in my 2nd web form because when the intellisense is displayed, there's no CallTrack in the options. Thanks!   How about using cross-...

Web resources about - How to get the return value from confirm message box? - asp.net.web-forms

Facebook Australia Confirms Interim Director Of Commercial Development And Sales
Facebook confirmed that Sales Director Liam Walsh has been serving and will serve as interim director of commercial development and sales for ...

4th XMRV Study Fails to Confirm Association with CFS - Facebook
The CFIDS Association of America hat eine Notiz mit dem Titel 4th XMRV Study Fails to Confirm Association with CFS geschrieben. Du kannst den ...

Facebook Confirms 200 Million Active User Mark
Just seven months after hitting the 100 million user mark last August and 90 days after hitting the 150 million mark in January, Facebook confirmed ...

Confirm Biosciences (@ConfirmBio) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Confirm Biosciences @ ConfirmBio ...

'How to Train Your Dragon' Character Comes Out as Gay, Director Confirms - YouTube
'How to Train Your Dragon' Character Comes Out as Gay, Director Confirms In the upcoming animated sequel to "How to Train Your Dragon," the rugged ...

BP confirms TNK stake to be sold
BP is in advanced discussions with the Russian state-controlled oil company Rosneft over the sale of the British company's stake in the troublesome ...

Bill Shorten to confirm Labor plan to increase tobacco taxes
... the cost of a $40 packet of cigarettes would be tax under a future Labor government in a policy move Opposition Leader Bill Shorten will confirm ...

Microsoft confirms the Windows 10 November Update WAS pulled and this is why
Over the weekend we spotted that the Windows 10 November Update (aka Threshold 2) had been removed from the Media Creation Tool (MCT), and had ...

Mark Hamill confirms he’ll be back as Luke Skywalker in Star Wars: Episode VIII
... about Luke's fate in the upcoming movie, which opens December 18th. Luke isn't even on the film's official poster. But Hamill just confirmed ...

Cheil PengTai and Tencent confirm new marketing partnership for Korean and ...
Marketing Interactive Cheil PengTai and Tencent confirm new marketing partnership for Korean and ... Campaign Asia-Pacific SEOUL - Cheil PengTai ...

Resources last updated: 11/28/2015 1:39:43 AM