Urgent help on the button click event

Posted by balajirnaukri-12656 under ASP.NET on 1/17/2012 | Points: 10 | Views : 991 | Status : [Member] | Replies : 4
Actually I am having a button on the page.On the button click event I should get the confirmation message like if its fine ok and cancel

I tried this

btnCreate.Attributes.Add("OnClientClick", "javascript:return confirm('Are you sure you want to create the organization with these credentials?');");

but Im not able to get it.Can anyone help me out.Very urgent.

Thanks and Regards
Balaji.R
ASP.NET Devloper
Solve-IT corp



Responses

Posted by: Ogipansrk on: 1/17/2012 [Member] Starter | Points: 25

Up
0
Down
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return confirm('Are you sure you want to delete?');" />

or


<title></title>
<script type="text/javascript" >
function Message() {
alert("hello");
}
</script>

add code in page_load

Button2.Attributes.Add("OnClick", "Message()");


balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Varung on: 1/17/2012 [Member] Starter | Points: 25

Up
0
Down
use ajax scriptmanager

G.Varun

balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 1/25/2012 [Member] Starter | Points: 25

Up
0
Down
You can do this by adding

using System.Windows.Form
if this is not available add this reference by right clicking reference folder->Add reference-select Syste,.windows.form

Messagebox.show("Your message" messageboxbutton.okcancel);

balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: reddysankark-13471 on: 1/25/2012 [Member] Starter | Points: 25

Up
0
Down
<head>
<script type="text/javascript">
var retval=confirm("do you want to continue");
if(retval==true)
{
alert("user wants to continue");
return true;
)
else
{
alert("user does not want to continue");
return false;
}

check this code

sankarreddy

balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response