|
Actually, I handle Application_Error event in Global.asax page and check if the application is not in Debug mode, then, Redirect the user to a customer error page, otherwise, show the error so that I can debug. I made a Windows Utility Application which has functionality such that, it can connect to FTP, download the web.config file, change the debug mode to either TRUE or FALSE and then upload the web.config file again to the server. For some reason, if my application crash in the production server, I run my Windows Utility Program to change the Debug mode to TRUE and then, I see the stack trace and error message immediately. This utility saves me from opening the Visual Studio, edit the config file, open FTP program, upload etc...etc..
So, will #debug directive work in this scenario ? So far I know, #debug directive is for Visual Studio, but when my web application recompile for new Web.Config file in the Server, will that respect the #debug directive ? I am not sure!
|
|
|
|
|
No #debug won't help in this case. I think the windows app is a bit overkill. Just edit the file with an ftp app, no need for VS.
You haven't described what errors you are getting.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks Mark,
I use FileZilla, and FileZilla does not have this feature to edit file in the server. Maybe some commercial FTP clients do. I just saved the money by creating this Windows App.
I am not talking about any specific error, I am saying, many times, if my Web Application crashes with un handled exceptions, then using that Windows App, I can immediately change to debug mode and see the error message.
Anyway, thanks a loot for bearing with me, giving me suggessions from your time.
Regards.
|
|
|
|
|
hi all,
when my page postedback after asp save button click it run the save another time,
if you save 1 book1
it will save twice
how to solve this problem?
thanks alot
|
|
|
|
|
DON'T post the same question again, once is enough. If anyone chooses to answer they will.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Are you sure you are not calling the save method twice? or you use cmd.ExecuteNonQuery() twice?
Paste the code you use and let's review it together.
|
|
|
|
|
Check the following in your code:
1-are you sure you are not saving a new book in the Page_load event of the page?
2-are you sure you are not calling the save method twice?
3-make sure that the procedure is saving one book.
if you want you can post your code to fix the issue.
|
|
|
|
|
hi all,
i develope a web site over visual studio 2005, when i press the save button (server side button) and the operation success, if i press F5 or refreh for the page
then the server side button event executed again and insert the same data.
how i can solve this problem?
thanks alot
|
|
|
|
|
In the save button's Click handler, you can add code to redirect the page to itself after executing the save logics.
Example:
Response.Redirect(Request.Url.ToString());
But, you will loose all ViewState data and the page will start as a instance and refresh wont cause save logic execute again. If you want to keep the ViewState data, things may get complicated.
|
|
|
|
|
Absolutely not. Horrible design and performance. Do you even understand hoe Response.Redirect works?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear Mark,
So far I found, it works, but did not get any other easy way to accomplish this task. Searching in google, some article also talked about this solution. But anyway, would you please tell me if you have any better alternative. I would love to learn that as it is also a common need for me.
Regards.
|
|
|
|
|
|
Hi Mark,
Thanks for the link. I highly appreciate.
As you asked if I know how Response.Redirect works, I just know that it sends HTTP Status code 302 and send HTTP Header 'Location' with the url I request. I did not get why it is a bad idea ? Can you please point me any article which explains about the side effects of Response.Redirect ?
Regards.
|
|
|
|
|
Response redirect sends a request to the client which immediately make another request to the server for the resource which is then sent back. An unnecessary round trip and waste of resources in most cases.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Have a look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello!
Just downloaded VS2010 and I'm looking for a complete tutorial about ASP.NET MVC2. Most of the sites like www.asp.net has no article about it
and i could'nt find anything interesting from begginer perspective.
Could anyone send me a link ? Or write and article about it ? I have a little bit background in web-forms but some topics in MVC are.... strange for me
TIA
Adrian
Adrian Pasik
|
|
|
|
|
There are some articles here, have you searched? ASP.NET MVC - Part 1[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yup and i want more
Adrian Pasik
|
|
|
|
|
is there any process or code so that once user logout thay cant not able to go back to there login page(from which page they are logout).
Thanks
|
|
|
|
|
If the user logs out and can't go back to the login page how will they ever return to your site?
I think you need to edit your question to make it more clear what you are asking
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes..its neccessary to prevent using web pages after being logged out.
there are following ways to do that...
if u r storing some session information while user logs in
clear it or abondon the session on logout event
Session.Abandon();
secondaly u can also clear the browser history on log out event
so that user cant navigate back
history.go(-history.length);
third, if ur using asp.net u can force ur page to load from server every
time instead from client cache. by this if user logs out and navigate back to
previous page he will be redirected to login page
mark property OutputCache to None or NoStore of Page
|
|
|
|
|
Why are you responding?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Web.Config
<system.web>
<authentication mode="Forms">
<forms loginurl="Your Login page" protection="Validation" timeout="60">
|
|
|
|
|
If you mean user should not be able to go back to the page they logged out from, yes, this is very much possible.
I would like to inform you that this is asked here so many times. So do a CodeProject search[^] and you will get a lot of hits.
I will give you a hint. Search for "disable back button" or just "disable back" for more results (select only question and answer check box to get results from Question and Answers). See if that helps you.
If you still don't understand, get back and explain your problem.
|
|
|
|
|
Yes..its neccessary to prevent using web pages after being logged out.
there are following ways to do that...
if u r storing some session information while user logs in
clear it or abondon the session on logout event
<b>Session.Abandon();</b>
secondaly u can also clear the browser history on log out event
so that user cant navigate back
<b>history.go(-history.length);</b>
third, if ur using asp.net u can force ur page to load from server every
time instead from client cache. by this if user logs out and navigate back to
previous page he will be redirected to login page
mark property <b>OutputCache to None or NoStore</b> of <b>Page</b>
|
|
|
|