Monday, March 26, 2012
newbie: logging exceptions, how?
I'm developing a ASP.NET 2.0 portal and are wondering how to implement some
kind of logging which logs all the exceptions which occur while the website
is running, So the administrator can view the log and discover problems,
like the website trying to access a page on another server, and this server
is down. Then it would be nice if problems like this could be logged!
I've looked into healthmonitoring and the EventLog class, What do you
recommend me to use? I think healthmonitroing is best but it's just that I
don't know how to use it. But I can learn :-)
Regarding healthmonitoring, this code below will of course throw an
exception. How do I know that healthmonitoring will log this error?
try{
int i = null;
int result = 100/i;
}
catch (Exception e) {
}
Best Regards!
JeffHello jeff,
U can just rethrow your errors in catch or dont use the catch, but handle
all error in Application_Error method at global.asax
Health Monitoring is just set of service methods which helps you to write
your errors to the desired source, such as eventLog, or file or send via
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
j> ASP.NET 2.0
j>
j> I'm developing a ASP.NET 2.0 portal and are wondering how to
j> implement some kind of logging which logs all the exceptions which
j> occur while the website is running, So the administrator can view the
j> log and discover problems, like the website trying to access a page
j> on another server, and this server is down. Then it would be nice if
j> problems like this could be logged!
j>
j> I've looked into healthmonitoring and the EventLog class, What do you
j> recommend me to use? I think healthmonitroing is best but it's just
j> that I don't know how to use it. But I can learn :-)
j>
j> Regarding healthmonitoring, this code below will of course throw an
j> exception. How do I know that healthmonitoring will log this error?
j> try{
j> int i = null;
j> int result = 100/i;
j> }
j> catch (Exception e) {
j> }
j> Best Regards!
j>
j> Jeff
j>
Jeff,
You may want to look at the Enterprise Library at
http://www.codeplex.com/entlib There's a loggin application block that
should do the trick for you and it's very adaptable.
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199...2006
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23tVbkvwnHHA.596@.TK2MSFTNGP06.phx.gbl...
> ASP.NET 2.0
> I'm developing a ASP.NET 2.0 portal and are wondering how to implement
> some kind of logging which logs all the exceptions which occur while the
> website is running, So the administrator can view the log and discover
> problems, like the website trying to access a page on another server, and
> this server is down. Then it would be nice if problems like this could be
> logged!
> I've looked into healthmonitoring and the EventLog class, What do you
> recommend me to use? I think healthmonitroing is best but it's just that I
> don't know how to use it. But I can learn :-)
> Regarding healthmonitoring, this code below will of course throw an
> exception. How do I know that healthmonitoring will log this error?
> try{
> int i = null;
> int result = 100/i;
> }
> catch (Exception e) {
> }
> Best Regards!
> Jeff
>
newbie: logging exceptions, how?
I'm developing a ASP.NET 2.0 portal and are wondering how to implement some
kind of logging which logs all the exceptions which occur while the website
is running, So the administrator can view the log and discover problems,
like the website trying to access a page on another server, and this server
is down. Then it would be nice if problems like this could be logged!
I've looked into healthmonitoring and the EventLog class, What do you
recommend me to use? I think healthmonitroing is best but it's just that I
don't know how to use it. But I can learn :-)
Regarding healthmonitoring, this code below will of course throw an
exception. How do I know that healthmonitoring will log this error?
try{
int i = null;
int result = 100/i;
}
catch (Exception e) {
}
Best Regards!
JeffHello jeff,
U can just rethrow your errors in catch or dont use the catch, but handle
all error in Application_Error method at global.asax
Health Monitoring is just set of service methods which helps you to write
your errors to the desired source, such as eventLog, or file or send via
email
--
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
jASP.NET 2.0
j>
jI'm developing a ASP.NET 2.0 portal and are wondering how to
jimplement some kind of logging which logs all the exceptions which
joccur while the website is running, So the administrator can view the
jlog and discover problems, like the website trying to access a page
jon another server, and this server is down. Then it would be nice if
jproblems like this could be logged!
j>
jI've looked into healthmonitoring and the EventLog class, What do you
jrecommend me to use? I think healthmonitroing is best but it's just
jthat I don't know how to use it. But I can learn :-)
j>
jRegarding healthmonitoring, this code below will of course throw an
jexception. How do I know that healthmonitoring will log this error?
jtry{
jint i = null;
jint result = 100/i;
j}
jcatch (Exception e) {
j}
jBest Regards!
j>
jJeff
j>
Jeff,
You may want to look at the Enterprise Library at
http://www.codeplex.com/entlib There's a loggin application block that
should do the trick for you and it's very adaptable.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:%23tVbkvwnHHA.596@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
ASP.NET 2.0
>
I'm developing a ASP.NET 2.0 portal and are wondering how to implement
some kind of logging which logs all the exceptions which occur while the
website is running, So the administrator can view the log and discover
problems, like the website trying to access a page on another server, and
this server is down. Then it would be nice if problems like this could be
logged!
>
I've looked into healthmonitoring and the EventLog class, What do you
recommend me to use? I think healthmonitroing is best but it's just that I
don't know how to use it. But I can learn :-)
>
Regarding healthmonitoring, this code below will of course throw an
exception. How do I know that healthmonitoring will log this error?
try{
int i = null;
int result = 100/i;
}
catch (Exception e) {
}
>
Best Regards!
>
Jeff
>
Saturday, March 24, 2012
newbie: user control question
Currently I have some asp.net pages that nearly implement the same
functionality - so I would like to combine them into one user control. My
question is: is it possible to pass parameters to the user control's
constructor? I would like to specify a parameter that tells the control what
to do internally (e.g. if param=1 then display textbox else display
dropdownbox). The parameter should be stored in ViewState. I could implement
public properties on the control, but I want the parameters to be set only
once.
Thanks
MarkusUser Control Constructors are not instantiated directly. Instead, you use
LoadControl() to load the UserControl. Therefore, I think going with
properties is your best bet.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Markus" <markus_nospam_stehle@.web.de> wrote in message
news:eZUT9au2DHA.3468@.TK2MSFTNGP11.phx.gbl...
> Hi all!
> Currently I have some asp.net pages that nearly implement the same
> functionality - so I would like to combine them into one user control. My
> question is: is it possible to pass parameters to the user control's
> constructor? I would like to specify a parameter that tells the control
what
> to do internally (e.g. if param=1 then display textbox else display
> dropdownbox). The parameter should be stored in ViewState. I could
implement
> public properties on the control, but I want the parameters to be set only
> once.
>
> Thanks
> Markus
Friday, March 16, 2012
News Ticker
I am currently working on a site and i need to implement a News Ticker into the Main Page i have and be display general information to users.
So i am looking for some examples in .Net everthing i have seen is done in Applets.
Could someone please point me in the right direction.
Thanks, RonMaybe you should take a look at htis product:
http://www.richcontentrotator.com/home.aspx
Hi freind,
I am facing the same problem you used to have. I tried to view the website that was sent to you but didn't find any help could you please advice me if you can.
Thanks :)