Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 22, 2013 06:03 AM by Danny117
Member
34 Points
11 Posts
Feb 16, 2013 12:06 AM|LINK
I just want to share this with you guys. If you are trying to get return value back from comfirm messagebox, here is the simple way.
1. insert HiddenField in the .aspx
2. Create a javascript function and include this code. like this
function DeleteMsg() { var Dmsg = confirm("You about to Delete all this record(s). Are you sure you want to continue ?"); document.getElementById('<%=HiddenDmsg.ClientID%>').value = Dmsg; return HiddenDmsg; }
3. Drag a Button in the interface and call your java function. Like this
<asp:Button ID="btnDelete" runat="server" Text="Delete" onclick="btnDelete_Click" class=" " OnClientClick="return DeleteMsg();" />
4. Received the value like this
protected void btnDelete_Click(object sender, EventArgs e) { string DelMsg = HiddenDmsg.Value; }
Hope this will help somebody.
Star
11160 Points
1932 Posts
Feb 22, 2013 06:03 AM|LINK
Thanks for the tip. Someone had just asked how to get the value of an on/off swich set on server code and you had the answer here. a hiddenfiled in the javascript you access with the clientid.
http://forums.asp.net/post/5303243.aspx
msogun document.getElementById('<%=HiddenDmsg.ClientID%>').value = Dmsg;
msogun
Member
34 Points
11 Posts
Confirm value return
Feb 16, 2013 12:06 AM|LINK
I just want to share this with you guys. If you are trying to get return value back from comfirm messagebox, here is the simple way.
1. insert HiddenField in the .aspx
2. Create a javascript function and include this code. like this
function DeleteMsg() {
var Dmsg = confirm("You about to Delete all this record(s). Are you sure you want to continue ?");
document.getElementById('<%=HiddenDmsg.ClientID%>').value = Dmsg;
return HiddenDmsg;
}
3. Drag a Button in the interface and call your java function. Like this
<asp:Button ID="btnDelete" runat="server" Text="Delete" onclick="btnDelete_Click" class=" " OnClientClick="return DeleteMsg();" />
4. Received the value like this
protected void btnDelete_Click(object sender, EventArgs e)
{
string DelMsg = HiddenDmsg.Value;
}
Hope this will help somebody.
Danny117
Star
11160 Points
1932 Posts
Re: Confirm value return
Feb 22, 2013 06:03 AM|LINK
Thanks for the tip. Someone had just asked how to get the value of an on/off swich set on server code and you had the answer here. a hiddenfiled in the javascript you access with the clientid.
http://forums.asp.net/post/5303243.aspx
Me on linked in