Re: Displaying messages/errors to users. Opinions?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

anonymous_at_discussions.microsoft.com
Date: 04/01/04


Date: Thu, 1 Apr 2004 09:18:21 -0800

Derek,

 Assuming you do not have a Base Class derived from Page
to handle common look and feel across fo application..

if you can afford to implement PageController architecture
explained below, it is cakewalk to handle the display of
this type of message and any other messages the way you
like..

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnpatterns/html/ImpPageController.asp

 Code for any UI could be centralized with this aproch

Regards
Sree

>-----Original Message-----
><< Response at the bottom of the page >>
>
>In article <#VykxM7EEHA.712@tk2msftngp13.phx.gbl>,
blizzardstorm8899
>@yahoo.com.sg says...
>> How abt using javascript in ur program. It is almost
similar to
>> MessageBox.Show in Windows Form Just type it the
following code into urs
>> and then pass in the relevant parameters. U can also
experiment with
>> Confirm. Just change the "alert" to Confirm. (I m not
very good in
>> Javascript so i may be wrong abt the syntax of confirm)
>>
>> Page.RegisterStartupScript("Your Header", "<script>"
+ "alert('" + "Your
>> Message" + "');" + "</script>");
>>
>>
>> "NewsMonkey" <newsmonkey@speakeasy.net> wrote in message
>> news:MPG.1ace99bf34549d8f989681@news.speakeasy.net...
>> > Hi All,
>> >
>> > I have been working on a few ASP.NET applications
recently that access
>> > database resources frequently. I have been trying to
find a consistent
>> > way of displaying both the success and failure of
various operations to
>> > the user. For example, if a new record is
successfully added then I
>> > would like to display a short message saying "The
record has been added
>> > successfully". Likewise if an error occurs then I
would like to display
>> > the "Message" attribute of the exception that was
thrown.
>> >
>> > The problem I am having, is coming up with a
consistent method of
>> > displaying these messages. Should I place the message
into a Session
>> > object and then redirect to a new page that reads the
message from the
>> > Session object? Another method I could use would be
to place the error
>> > message into the body of a hidden "<DIV></DIV>"
element and then set the
>> > visibility to "visible". I guess I am just looking
for tips and
>> > techniques that others use to accomplish this sort of
task, also, any
>> > "tutorial/articles" that might cover this subject
would be very helpful.
>> > It would be great if I could "aggregate" the
functionality into a
>> > reusable class or object and just use it within other
asp.net
>> > applications. Thanks in advance for any help!
>> >
>> > - DereTheGeek
>
>
> Javascript, though good for quick messages and choices
for users,
>would not be a good solution for what I am trying to do?
At least thats
>what I am thinking. I want to be able to display a
formatted message to
>the user that something has occurred. In this message it
would be nice
>to have a navigation bar so the user can then go to the
next section of
>the application that they would like.
>
> I have been using Session objects in the following
manner..
>
>// after record update is successful
>Session["Message"] = "The record update was successful";
>Response.Redirect("DisplayMessage.aspx");
>
> I am wondering if there is a better way to do this?
>
>- Derek



Relevant Pages

  • Re: Turners Websites......
    ... there is very little javascript ... The main reason I was looking at using slideshow type picture ... You say that you're not an HTML guy, but you're jumping head first into ... slideshow to display various gallerys on different pages of my site. ...
    (rec.crafts.woodturning)
  • Re: Mobile IE changing display properties in CSS
    ... with - display:; - but I don't like your chances. ... I started javascript only to help small screen users and give them some additional accessibility features: larger fonts, avoid narrow native keypads by using spezialized character selections which are displayed by larger buttons/links, validation at input ... ... Using javascript for porting existing cross platform Web applications to Mobile Web applications seems to be my major design decision failure in the moment. ...
    (comp.lang.javascript)
  • Re: Bad advice from a spammer
    ... If this text is displayed, your email client cannot display ... no HTML and especially no Javascript - ... creamin yer panties before it's time to pop the champagne proper." ...
    (alt.2600)
  • Re: Some jpgs wont display
    ... > Good news, in a way - directly embedded the image in the web page and it ... Something about the javascript slideshow maybe causing the ... But try to display in a javascript ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: logic help in servlet
    ... i just made use of session objects that save the data on the first ... Use JavaScript and DHTML. ... and then to fill in data you can write out JavaScript ... Use a Refresh header to cause the page to regularly refresh itself. ...
    (comp.lang.java.help)