|
Hi,
We have developed website using ASP.NET,C#. But they are runtime errors and we got yellow pages.
So How do we catch Runtime errors and Log them?
please advice.
|
|
|
|
|
Do you not run your application in a microsoft development package i.e. VWD ot VS, usually you can debug in that
|
|
|
|
|
First you need to find which types of runtime error your website is getting if those are catchable put that code in try and catch block
and Where do you want to logg that error ? are you guys are creating text files for logging
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
web.config files SHOULD help... Hide's those nasty error pages, makes it so you can't add .cs onto files (Admin.aspx.cs ftl...), and ALOT more
http://www.google.co.za/search?q=web.config
|
|
|
|
|
Might be replied to wrong person
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Well, a web.config file can stop runtime errors from displaying(And can possibly log them)
|
|
|
|
|
pubududilena wrote: So How do we catch Runtime errors and Log them?
When any uncaught exception occurs, ASP.NET fires Application_Error event. Global.asax is having the event handler defined, you can use that. Or write a custom HTTP module and hook application error event. For logging, I have used log4net[^] - it's a great product.
Alternatively you can use web.config's custom error section. When any error occurs, it will be redirected to the specified page. But if the application is running in heavy traffic, this won't be a good approach.
|
|
|
|
|
hi all,
how to import data from excel to sql server 2005 either by using ado.net or asp.net 2.0 and c#
Ashok
|
|
|
|
|
Don't cross post
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Do u know Export Or import in sql server 2005 ??
regards,
Rana Krishnraj
|
|
|
|
|
Thats why he has asked a question
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi ,
just copy and paste from xl to sql server 2005
Ashok
|
|
|
|
|
HOw to display a html web page with the help of image button
control.like which event do we use..
can tell me in details...I am using visula studio-2005 with C# as backend
modified on Thursday, April 3, 2008 2:30 AM
|
|
|
|
|
The image button control has a Click event. Handle this and redirect to your HTML page.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
I m not getting but, exactly what u want to do?? Can u specify yr problem ?
regards,
Rana Krishnraj
|
|
|
|
|
Thing is that i am developing an asp.net application. in which i have desiging with certain imagebutton control.
like Objective.Aboout us.
I want when i clicked on objective image button it shold display the obj.htm webpage in the browser.
i have tried this with postbackurl property but it shows the error. "The HTTP verb POST used to access path '/rwssMIS/obj.htm' is not allowed."
so how to display that htmlpage???
|
|
|
|
|
Can you post your code please to help us see what is happening
|
|
|
|
|
hai
this is my code about whome ur atalking about..
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head id="Head1" runat="server"><br />
<title>Untitled Page</title><br />
<script type="text/javascript" language="JavaScript" src="news/news_eng.js"></script><br />
<link rel="stylesheet" href="scripts/rwsstyle.css" type="text/css" /><br />
<script type="text/javascript" language="javascript"><br />
var swidth=323;<br />
var sheight=115;<br />
var sspeed=1;<br />
var wholemessage="<ul>";<br />
<br />
for(i=0; i<theSummaries.length; i++)<br />
{<br />
if(i==theSummaries.length-1)<br />
{<br />
wholemessage=wholemessage+"<li><a class='ver10pxblack' href='outerwin.htm?id="+theSiteLinks[i] +"' target='_blank'>"+theSummaries[i]+"</a></li>";<br />
}<br />
else<br />
{<br />
wholemessage=wholemessage+"<li><a class='ver10pxblack' href='outerwin.htm?id="+theSiteLinks[i] +"' target='_blank'>"+theSummaries[i]+"</a><br><br></li>";<br />
}<br />
}<br />
<br />
wholemessage = wholemessage+"</ul>";<br />
<br />
</script><br />
<br />
<style type="text/css"><br />
<br />
.ver10pxblack {<br />
FONT-SIZE: 10px; COLOR: #000000; FONT-FAMILY: Verdana<br />
}<br />
<br />
A:link {<br />
TEXT-DECORATION: none<br />
}<br />
A:visited {<br />
TEXT-DECORATION: none<br />
}<br />
A:hover {<br />
TEXT-DECORATION: underline<br />
}<br />
A:active {<br />
TEXT-DECORATION: none<br />
}<br />
</style><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<table style="width:720px;height:494px;" cellpadding="0" cellspacing="0" border="0" ><br />
<tr><br />
<td style="height:494px;width:480px;" align="left" bgcolor="#d9dadc" valign="top"><br />
<p class="left"><img src="images/e03.gif" alt="" width="14" height="16" border="0" align="absmiddle" /> <br />
<strong>NEWS & EVENTS</strong></p><br />
<br />
<script type="text/javascript" language="JavaScript"><br />
if (document.all)<br />
{<br />
document.writeln('<marquee id="ieslider" scrollAmount=1 width=100% height=60% direction=up style="border:0;">');<br />
document.writeln(wholemessage);<br />
ieslider.onmouseover = new Function("ieslider.scrollAmount=0");<br />
ieslider.onmouseout = new Function("if (document.readyState == 'complete') ieslider.scrollAmount=1");<br />
document.write('</marquee>');<br />
}<br />
</script><br />
</td><br />
<td style="height:494px;width:240px;" bgcolor="#106AB1"><br />
<table width="240px" cellpadding="0" cellspacing="0" border="0"><br />
<tr><br />
<td align="center" colspan="2" style="height:98px;width:240px;" ><br />
<p class="style5" ><br />
<span style="color:lightgoldenrodyellow; font-family:Arial;">Shri S.N. Tripathy, IAS,<BR/><br />
Commissioner-cum-Secretary to Govt <br/> <br />
................................................... <br/><br />
Er. P.K Panigrahi<br /><br />
Chief Engineer, RWS&S</span></p><br />
</td><br />
</tr><br />
<tr style="height:22px;width:240px;"><br />
<td colspan="2" align="center" style="width: 100%; "><img src="images/log.gif" width="100%" alt="" border="0" /></td><br />
</tr><br />
<tr><br />
<td width="1px" colspan="2"> </td><br />
</tr><br />
<tr><br />
<td style="width:30%;height:22px;" align="left"><p style="color: #FFFFFF; "><b>  USER ID </b></p></td><br />
<td style="width: 70%;height:22px;" align="center"><asp:TextBox ID="txtbxuid" runat="server" ></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td style="height:22px;;width:30%;" align="left"><p style="color: #FFFFFF;"><b>  PASSWORD </b></p></td><br />
<td style="height:22px;; width: 70%;" align="center"><asp:TextBox ID="txtbxpwd" runat="server" TextMode="Password" ></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td style="height:22px;;width:30%;text-align:left;"><p style="color: #FFFFFF;"><b>  USER TYPE </b></p></td> <br />
<td style="height:22px;;width:70%;" align="center"><asp:RadioButtonList ID="rdbtnuser" runat="server" RepeatDirection="Horizontal" ForeColor="white"><br />
<asp:ListItem Selected="True">USER</asp:ListItem><br />
<asp:ListItem>ADMIN</asp:ListItem></asp:RadioButtonList></td><br />
</tr><br />
<tr><br />
<td align="center" colspan="2" style="height:27px;"><asp:ImageButton ID="Imglogin" AlternateText="Login" runat="server" ImageUrl="~/images/login3.gif" OnClick="Imglogin_Click" /></td><%----%><br />
</tr><br />
<tr><br />
<td align="center"colspan="2" style="height: 3px;" ><asp:Label id="loginError" runat="server" ForeColor="Gold" Text= ></asp:Label><br />
</td><br />
</tr><br />
<tr><br />
<td colspan="2" style="height:246px;"><br />
<table border="0" cellpadding="0" style=" background-image: url(images/menubg.GIF); border-top: inactivecaptiontext thin solid;"><br />
<tr ><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImgbtnObj" AlternateText="Objective" runat="server" ImageUrl="~/images/obj.gif" PostBackUrl="~/obj.htm" /><br />
</td></tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="imgbtnWpolicy" AlternateText="Policy" runat="server" ImageUrl="~/images/policy.gif" OnClick="imgbtnWpolicy_Click" /><br />
</td><br />
</tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImageButton3" AlternateText="PhotoGallary" runat="server" ImageUrl="~/images/photogal.gif"/></td></tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImageButton4" AlternateText="E-mail dir" runat="server" ImageUrl="~/images/emaildir.gif" PostBackUrl="~/EmailDir.aspx" /></td></tr><br />
<tr><br />
<td align="center" style="width: 25%; height: 28px;" ><br />
<asp:ImageButton ID="ImageButton5" AlternateText="Telephone Dir" runat="server" ImageUrl="~/images/telephone.gif" PostBackUrl="~/Telephonedir.aspx" /></td></tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImageButton6" AlternateText="District Info" runat="server" ImageUrl="~/images/dist.gif"/></td></tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImageButton7" AlternateText="Related links" runat="server" ImageUrl="~/images/links.gif" /></td></tr><br />
<tr><br />
<td align="center" style="width: 25%;" ><br />
<asp:ImageButton ID="ImageButton8" AlternateText="Organsation Setup" runat="server" ImageUrl="~/images/org.gif" /></td></tr><br />
</table><br />
</td><br />
</tr><br />
</table><br />
</td><br />
</tr><br />
</table><br />
</div><br />
</form><br />
</body><br />
</html><br />
|
|
|
|
|
Couldn't you just use onclick method for the button or am I missing the point?
|
|
|
|
|
Hi dear,
i see yr code. in some image button u use onClick event and in other image button u use PostBackurl. I don't understand why it is so. but its better to use code-behind file and use click event of image button. Hope u understand what i want to say.
regards,
Rana Krishnraj
|
|
|
|
|
I have an aspx website.I am trying to delete one user. While deleting I need to delete all files in one directory named "username" and after that the directory itself. The program deletes the files , but while deleting the directory it throws an exception saying "The directory is not empty". I am using the following code
if (System.IO.Directory.Exists(Server .MapPath ("Albums/username" ))
{
System.IO.Directory.Delete(Server .MapPath ("Albums/username"));
}
If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB.
Note: I am using this folder to store some images.
|
|
|
|
|
Directory.Delete takes a second argument which, when set to true, causes all subdirectories and files to be deleted from the specified directory.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Soumini Ramakrishnan wrote: If you double click on the folder, you will see an empty one. But if the folder's properties is taken, it shows that it contains a file with size 8 KB.
Are hidden file's and system file's displays on?
"Sometimes the greatest journey is the distance between two people" - Nice quote from a Nice Indian Movie
|
|
|
|
|
Dear Sir/Madam
i am the beginer in asp.net.i have problem in sending emails.
MailAddress SendFrom = new MailAddress("xxx@domainname.com");
MailAddress SendTo = new MailAddress("pediatric_info@yahoo.com");
MailMessage MyMessage = new MailMessage(SendFrom, SendTo);
MyMessage.Subject = "dfgdfgdfg";
string strBody = "<html><body><b>Thanks for registering in infection in children</b><br/><br/>" +
"<font color=\"red\">Your registration details are as follows:<br /><br /></font>Username='" + username + "' and <br />Password='" + hdn_password.Value + "'<br /><br/> Please keep this information for future reference.</body></html>";
MyMessage.Body = strBody;
SmtpClient emailClient = new SmtpClient("mail.domainname.com");
emailClient.Send(MyMessage);
this is the code is used neither i am getting any error nor receiving any mails.i am unable to understand where i am facing problem.
please........help! help! help!
|
|
|
|
|
Have U chacked in spam in your mail account??
The Great Pleasure In Doing That Things That Other People Say U Can't By Doing This U Can Shut Their Mouth
|
|
|
|