<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx</link><description>One of the most common mistakes beginner ASP.NET developers make is to call MsgBox.Show from their ASP.NET server-side code. It is a mistake because this code runs server-side and will just display the message box on the server where it's not going to</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#7075099</link><pubDate>Wed, 06 May 2009 20:03:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7075099</guid><dc:creator>Sean Perry</dc:creator><author>Sean Perry</author><description>&lt;p&gt;Bertrand: I put a label inside the alert, passed the label to my utility, set label.text = &amp;#39;error message string&amp;#39; and it worked perfectly. I feel a little dumb looking for long programatic solutions when like you pointed out the alert contents can be set up like any html page. Thank You for the help and the very usefull control. &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7075099" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#7075070</link><pubDate>Wed, 06 May 2009 19:24:39 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7075070</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Sean: haven't touched that code in a while, but from the top of my head, the control uses its own contents as the text of the alert, so if you add a literal control to it with your message, it should work.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7075070" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#7075056</link><pubDate>Wed, 06 May 2009 19:06:54 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7075056</guid><dc:creator>Sean Perry</dc:creator><author>Sean Perry</author><description>&lt;p&gt;Bertrand I put this in my website and it works perfectly. I just have one problem that I am sure is my own lack of understanding. I have a central utility that carries out actions and posts various alerts if something goes wrong. The error message is passed as a string from server side code of the page to the server side code of the utility. I managed to get the utility to post the alert by using &amp;#39;Imports Microsoft.Samples.Alert&amp;#39; but I can&amp;#39;t find a way to get the error message string into the alert. There are many text options on the Alert Object like ServerAlert.Title or ServerAlert.OKText but there doesn&amp;#39;t seem to be a ServerAlert.MessageText I noted in the html you have &amp;#39;This is a rich alert box that was triggered by&amp;lt;br /&amp;gt;&amp;lt;i&amp;gt;server-side code&amp;lt;/i&amp;gt;&amp;#39; I am guessing that I can call a serverside proceedure between the &amp;lt;i&amp;gt;&amp;#39;s to supply text but I don&amp;#39;t know the syntax or how.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7075056" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#7063888</link><pubDate>Tue, 28 Apr 2009 17:41:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7063888</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Alex: you forgot to copy the alert/displayalert.htm file to your site.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7063888" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#7063812</link><pubDate>Tue, 28 Apr 2009 16:23:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7063812</guid><dc:creator>Alex Taylor</dc:creator><author>Alex Taylor</author><description>&lt;p&gt;Added the Alert control to my project without issues, and it compiles fine, but when I trigger the .Show() method, the message box opens with an HTTP 404 in it, instead of the specified HTML.&lt;/p&gt;
&lt;p&gt;I use Master Pages for my layout, if that makes any difference (downloaded it today from codeplex so I should have the latest version).&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7063812" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#6774459</link><pubDate>Tue, 09 Dec 2008 07:33:18 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6774459</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Vaishali: 1.1? Wow. that's old. Sorry, this is compiled against 2.0.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6774459" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#6771831</link><pubDate>Mon, 08 Dec 2008 13:54:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6771831</guid><dc:creator>Vaishali Nayer</dc:creator><author>Vaishali Nayer</author><description>&lt;p&gt;How can I use the Alert.dll in VS2003, when I try to add a reference to it i get an error message saying&lt;/p&gt;
&lt;p&gt;&amp;quot;A reference to XXX could &amp;nbsp;not be added. &amp;nbsp;This is not a valid assembly or COM component. &amp;nbsp;Only assemblied with extension &amp;#39;dll&amp;#39; and COM components can be referenced. &amp;nbsp;Please make sure that the file is accesible and that it is a valid assembly or COM component&amp;quot;&lt;/p&gt;
&lt;p&gt;Using .Net 1.1&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6771831" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#6573319</link><pubDate>Thu, 28 Aug 2008 04:59:59 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6573319</guid><dc:creator>Raj</dc:creator><author>Raj</author><description>&lt;p&gt;hmmm. not left with that much time i guess. Let me see if i can do something about it. If i get any solution, will post it here. Thanks a lot for your help.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6573319" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#6568629</link><pubDate>Tue, 26 Aug 2008 18:22:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6568629</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;The control in the Ajax Toolkit doesn't really use Ajax, so you might be able to reuse some of the code in there although it might be quite a lot of work. I guess your options would be to live with the status bar, make your own control using techniques similar to what the Toolkit is doing or use the toolkit.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6568629" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Alerts: how to display message boxes from server-side code?</title><link>http://weblogs.asp.net/bleroy/archive/2005/12/01/asp-net-alerts-how-to-display-message-boxes-from-server-side-code.aspx#6567701</link><pubDate>Tue, 26 Aug 2008 13:13:30 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6567701</guid><dc:creator>Raj</dc:creator><author>Raj</author><description>&lt;p&gt;Hi, i am not supposed to use AJAX, any other way to solve this problem other than using ajax?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6567701" width="1" height="1"&gt;</description></item></channel></rss>