Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 01, 2012 05:14 AM by chaaraan
Member
11 Points
103 Posts
Apr 30, 2012 10:10 AM|LINK
how can we show msg box in asp.net page without using java script.
i want to use if else condition on yes or no button
All-Star
16797 Points
2608 Posts
MVP
Apr 30, 2012 10:18 AM|LINK
No the code is running on the web server and you want to see the message box on the client. The closest you can come to a message box from the code behind is something like the ajax toolkits modal popup extender
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
Participant
878 Points
264 Posts
you can go with popup window
that window would be trated as your custom messagebox and on which place the button and fuctonalities you want
http://forums.asp.net/t/1530469.aspx
1370 Points
372 Posts
I think it's impossible to do. If you can do that, you will get show msg box, but not work properly.
210 Points
51 Posts
Apr 30, 2012 10:19 AM|LINK
Hello,
Its not possible to do this properly withouyt using js. I would suggest you to use Javascript.
86555 Points
9624 Posts
Moderator
Apr 30, 2012 10:21 AM|LINK
You cannot use a MessageBox in an asp.net application. The messagebox would not appear to the user, it would appear on the server instead.
You *must* use JavaScript. There is no other way. If you don't want to use JavaScript, then you cannot show anything that looks like a messagebox.
For something similar, you can use the ASP.NET AJAX Modal Popup: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
Or use a jQuery Dialog: http://jqueryui.com/demos/dialog/
16394 Points
3170 Posts
Apr 30, 2012 10:23 AM|LINK
You can use a ModalPopup available in AJAX tookit:
Apr 30, 2012 12:17 PM|LINK
im using that code.
asp:LinkButton ID="lbn_job_det" runat="server" Text="View Job Details" Font-Names="Calibri"></asp:LinkButton>
<ajaxtoolkit:modalpopupextender id="ModalPopupExtender" runat="server" backgroundcssclass="modalBackground" cancelcontrolid="CancelButton" dropshadow="true" okcontrolid="OkButton" popupcontrolid="Panel1" popupdraghandlecontrolid="Panel3" targetcontrolid="lbn_job_det"></ajaxtoolkit:modalpopupextender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="380px" Height="96px">
<div>
<p style="text-align: center">
<table width="100%">
</table>
<br /><br />
<asp:Button ID="OkButton" runat="server" Text="OK" onclick="OkButton_Click" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</p>
</div>
</asp:Panel>
that code working fine but button event not fire
protected void OkButton_Click(object sender, EventArgs e)
{ }
Contributor
2170 Points
484 Posts
May 01, 2012 05:14 AM|LINK
Hi,
In ModalPopupExtender , remove the tag okcontrolid and check
<ajaxtoolkit:modalpopupextender id="ModalPopupExtender" runat="server" backgroundcssclass="modalBackground"cancelcontrolid="CancelButton" dropshadow="true" popupcontrolid="Panel1"popupdraghandlecontrolid="Panel3" targetcontrolid="lbn_job_det"></ajaxtoolkit:modalpopupextender>
Hope this helps
Regards,
Charan
zohaibak
Member
11 Points
103 Posts
message box show
Apr 30, 2012 10:10 AM|LINK
how can we show msg box in asp.net page without using java script.
i want to use if else condition on yes or no button
Ken Tucker
All-Star
16797 Points
2608 Posts
MVP
Re: message box show
Apr 30, 2012 10:18 AM|LINK
No the code is running on the web server and you want to see the message box on the client. The closest you can come to a message box from the code behind is something like the ajax toolkits modal popup extender
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
Space Coast .Net User Group
ZeeshanAnsar...
Participant
878 Points
264 Posts
Re: message box show
Apr 30, 2012 10:18 AM|LINK
you can go with popup window
that window would be trated as your custom messagebox and on which place the button and fuctonalities you want
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
http://forums.asp.net/t/1530469.aspx
Please 'Mark as Answer' if this post helps you.
teguhyuliant...
Participant
1370 Points
372 Posts
Re: message box show
Apr 30, 2012 10:18 AM|LINK
I think it's impossible to do. If you can do that, you will get show msg box, but not work properly.
Ashley.Jones
Member
210 Points
51 Posts
Re: message box show
Apr 30, 2012 10:19 AM|LINK
Hello,
Its not possible to do this properly withouyt using js. I would suggest you to use Javascript.
DarrellNorto...
All-Star
86555 Points
9624 Posts
Moderator
MVP
Re: message box show
Apr 30, 2012 10:21 AM|LINK
You cannot use a MessageBox in an asp.net application. The messagebox would not appear to the user, it would appear on the server instead.
You *must* use JavaScript. There is no other way. If you don't want to use JavaScript, then you cannot show anything that looks like a messagebox.
For something similar, you can use the ASP.NET AJAX Modal Popup: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
Or use a jQuery Dialog: http://jqueryui.com/demos/dialog/
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
nijhawan.sau...
All-Star
16394 Points
3170 Posts
Re: message box show
Apr 30, 2012 10:23 AM|LINK
You can use a ModalPopup available in AJAX tookit:
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
zohaibak
Member
11 Points
103 Posts
Re: message box show
Apr 30, 2012 12:17 PM|LINK
im using that code.
asp:LinkButton ID="lbn_job_det" runat="server" Text="View Job Details" Font-Names="Calibri"></asp:LinkButton>
<ajaxtoolkit:modalpopupextender id="ModalPopupExtender" runat="server" backgroundcssclass="modalBackground" cancelcontrolid="CancelButton" dropshadow="true" okcontrolid="OkButton" popupcontrolid="Panel1" popupdraghandlecontrolid="Panel3" targetcontrolid="lbn_job_det"></ajaxtoolkit:modalpopupextender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="380px" Height="96px">
<div>
<p style="text-align: center">
<table width="100%">
</table>
<br /><br />
<asp:Button ID="OkButton" runat="server" Text="OK" onclick="OkButton_Click" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</p>
</div>
</asp:Panel>
that code working fine but button event not fire
protected void OkButton_Click(object sender, EventArgs e)
{ }
chaaraan
Contributor
2170 Points
484 Posts
Re: message box show
May 01, 2012 05:14 AM|LINK
Hi,
In ModalPopupExtender , remove the tag okcontrolid and check
<ajaxtoolkit:modalpopupextender id="ModalPopupExtender" runat="server" backgroundcssclass="modalBackground"cancelcontrolid="CancelButton" dropshadow="true" popupcontrolid="Panel1"popupdraghandlecontrolid="Panel3" targetcontrolid="lbn_job_det"></ajaxtoolkit:modalpopupextender>
Hope this helps
Regards,
Charan