What I'm looking to do is lock the application so the admin can do maintenance for however long. All i want to do is be able to click a button on a "maintenance" page and it makes it so anyone who attempts to use the system and anyone who is already in the system is redirected to a page, if they try to do anything, that says the site is down for maintenance.
on postback, on redirect, etc. No Access until that button is clicked again to unlock.
I have an ASP.NET site that I'm going to have to take down to make some major structural updates to, and I was wondering how I should go about it from the client-side perspective. I have heard of an App_Offline.htm file or something like that, but I've never really gotten that to successfully work. Does anyone know how to do this?
EDIT
My app is running ASP.NET 4.0, for what it is worth.
How does one put up a server maintenance page or reference..
Do you build a whole separate asp.net project with you basic page and logo and use that on the domain, until your main project is back up and running..
I want to put website in maintenance mode, so i can rollover my new stuff. How can i keep users away from loging into my website and i will test my website live.
App_offline.html takes admin away as well. Is there any logical way of doing this?
I'm looking for a simple webform for maintenance of a SQL Server which has only two columns: LookupID (int, not null) identity and LookupValue (nvarchar (50), not null).
A web application works with the database. Once a day, the database should be scanned and alerts should be sent to users. From what I've seen out there, additional project has to be created which will be installed on the server and will work with the same database. Executable created by this project has to be installed in Windows scheduler to be activated once a day.This seems complicated and inefficient: starting additional executable and working on the same database.
I have been tasked with producing a web application for a new client. What they're looking for requires a Gridview with slave Detailsview within an Update Panel.
I produced this, including the Gridview in markup, as follows:[Code].... [Code]....
However, although it works, it's been requested that I move most of this to code behind (for easier maintenance), which is causing me a few headaches.
What is the correct option here, since I see many potential methods?
Should I create an instance of the Gridview and Update Panel in markup, then define all events and columns in code behind? Create a new Gridview entirely in code behind and place it within the Update Panel? Create both in code behind?
I need to maintain daily attendance of every employee ...
Salary is given on 1st of every month , minimum CL for an employee is 12 days in a year. After 12 days , if he or she absent more than 12 days of CL , then deduct from his or her salary amount to be paid next times.
I am using VS2005 and I have a solution file (.SLN) which has 8 projects. I moved the solution file to a different path on a shared folder to have better organization of my projects and to allow access to the solution/projects from any computer on the network. After that, I edited the .SLN file so that the path of the projects in the solution file are correct (all on shared folders).
After that, I opened the .SLN and everything seemd to be working fine. However, I notcied that the "Start Options" of the website part of the solution file is missing the "Start Options", ie, the Start Options are reset to default values. I think also, but not sure, some other settings of the Solution/Projects have been reset.
Questions:
1. Where the Web Site "Start Options" are stored ?
2. How I can maintain the Start Options and similar settings if the .SLN file is moved or opened from different computers on the network ?
3. I am not using an team development tools, only plain (vanilla) VS 2005 Prof. Edition. Is it possible to have 2 or more developers work on the same solution/projects (shared on the network), if both developers will coordinate manually simultanous access to the porject files/resources/source code ?
In one of our ASP.NET Web site solutions I need to roll out an update that might take reasonable time. It spawns multiple Windows Azure Workers and projects and so simple Deployment Swap is ruled out.
Essentially I'm just thinking about way to redirect all web requests to a "site is under maintenance" page for some time, given the project is under Windows Azure.
I'm aware of the app-offline.htm trick with IIS, but I doubt that Azure Web Role will allow this one to be deployed or run (it spins down the app domain).
In order to show a "site under maintenance" page we are looking at two alternatives.
1) Have an app_Offline.htm page and sync it to the server when maintenance starts.
2) Create a separate folder with a totally different site (which can show a lot more dynamic information than what we can with the app_offline page). During maintenance, it is being that we change the virtual folder mapping of the site to point to this other folder while we work on updating the site.
Is there a way to change the virtual folder to point to another folder using MSDeploy? Is there any other way to do this via a script rather than having to go to each server and manually change the folder ?
In asp.net 3.5, what's the best (most convenient) way to redirect users to a page that informs them the "Site is currently undergoing maintenance. check back later."
Originally, someone recomended setting the starting page in IIS, but I don't have access to IIS (hosting company does) so that's not an option. Another person said to go into visual studio, right-click on the desired starting page, and mark it as "Set as start page", but that would involve recompiling & uploading the website EVERY time I want to perform maintenance & then recompile again once I'm done.
Am I able to specify the start page in my web.config file or something along these lines?
A few months ago I was interviewing for a job inside the company I am currently in, I dont have a strong web development background, but one of the questions he posed to me was how could you improve this block of code.I dont remember the code block perfectly but to sum it up it was a web hit counter, and he used lock on the hitcounter.
lock(HitCounter) { // Bla... } However after some discussion he said, lock is good but never use it in web applications!What is the basis behind his statement? Why shouldnt I use lock in web applications?
Is their a wayin sql server 2005 to change some type of setting on a data table so that it can not be updated or inserted into?
My problem is that I have a data table that is somehow being populated by an application. I have looked through all of the stored procs, views, functions and the C# code itself. I can't find out where or how it is populating a certain data table. So I figure if I can somehow make the table non updateable, then I can find out where the insert/update is occuring.
This would all occur in a test environment of course.
I'm developing an ASP.NET forms webapplication using C#. I have a method which creates a new Order for a customer. It looks similar to this; private string CreateOrder(string userName) { // Fetch current order Order order = FetchOrder(userName);[code]....
The problem here is, it is possible that 1 customer in two requests (threads) could cause this method to be called twice while another thread is also inside this method. This can cause two orders to be created.
How can I properly lock this method, so it can only be executed by one thread at a time per customer?
Can I lock a record that is being edited, and restrict more than one user from editing the same record at the same time? using VB.NET or SQL Stored Procedure.
I intend to around existing code snippet (updating a Hashtable) with lock() block to prevent multiple threads (launched by ASP.NET web site) from simultaneously updating a Hashtable.
Bc this is first time I do in this measure, I need your advice on
Any performance overhead caution caused by lock() Any other issues you ever experienced similar to this scenarios.
I have a deadlock problem that occurs every 5 minutes on SQL update. I get the following error randomly - means qurey failed one time every 200 calls. I'm using transaction scope to manage transaction.
code:
using(TransactionScope scope = new TransactionScope()) { SELECT ... FROM TABLE1 UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId scope.Complete(); } error: System.Data.SqlClient.SqlException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DAL.RunSQL(String query, SqlParameter[] parameters, Boolean openTransact) in C:prjDAL.cs:line 215 I took trace in SQL about deadlock and same SQL query is mentioned bu deadlock. I do not understand how to resolve this deadlock. SQL log: deadlock-list deadlock victim=process5462718 process-list process taskpriority=0 logused=0 waitresource=KEY: 20:72057597472604160 (ce004d0b917a) waittime=30 ownerId=5937428 transactionname=user_transaction lasttranstarted=2010-10-20T16:29:04.050 XDES=0x5d00280 lockMode=X schedulerid=2 kpid=2168 status=suspended spid=65 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2010-10-20T16:29:04.110 lastbatchcompleted=2010-10-20T16:29:04.110 clientapp=.Net SqlClient Data Provider hostname=IPTBEWKS017 hostpid=3112 loginname=iptuserjde isolationlevel=serializable (4) xactid=5937428 currentdb=20 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056 executionStack frame procname=adhoc line=1 stmtstart=222 sqlhandle=0x0200000086adfa0c959ccbdd7ef0e31e854e3a987706ae38 UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId frame procname=unknown line=1 sqlhandle=0x000000000000000000000000000000000000000000000000 unknown inputbuf (@UId nvarchar(9),@F1 nvarchar(9),@F2 nvarchar(9),@F3 int,@F4 int,@F5 datetime)UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId process taskpriority=0 logused=0 waitresource=KEY: 20:72057597472604160 (cc0078aef293) waittime=88 ownerId=5937412 transactionname=user_transaction lasttranstarted=2010-10-20T16:29:04 XDES=0x2b028280 lockMode=X schedulerid=1 kpid=6788 status=suspended spid=74 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2010-10-20T16:29:04.050 lastbatchcompleted=2010-10-20T16:29:04.050 clientapp=.Net SqlClient Data Provider hostname=IPTBEWKS017 hostpid=3112 loginname=iptuserjde isolationlevel=serializable (4) xactid=5937412 currentdb=20 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056 executionStack frame procname=adhoc line=1 stmtstart=222 sqlhandle=0x0200000086adfa0c959ccbdd7ef0e31e854e3a987706ae38 UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId frame procname=unknown line=1 sqlhandle=0x000000000000000000000000000000000000000000000000 unknown inputbuf (@UId nvarchar(9),@F1 nvarchar(9),@F2 nvarchar(9),@F3 int,@F4 int,@F5 datetime) UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId resource-list keylock hobtid=72057597472604160 dbid=20 objectname=dbipt_rc41_02.dbo.TABLE1 indexname=PK_TABLE1 mode=RangeS-U associatedObjectId=72057597472604160 owner-list owner id=processdbbe40 mode=RangeS-S waiter-list waiter mode=X requestType=convert keylock hobtid=72057597472604160 dbid=20 objectname=dbipt_rc41_02.dbo.TABLE1 indexname=PK_TABLE10 mode=RangeS-U associatedObjectId=72057597472604160 owner-list owner mode=RangeS-S waiter-list waiter id=processdbbe40 mode=X requestType=convert
I have tried to analyse the trace with this post but unsuccessfully: [URL] UId is my primary key - I do select on F3 column just before in same transaction but i have also an index on F3 column.
-> Spid 65 is running this query (line 2 of proc [p1]): UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId Spid 74 is running this query (line 2 of proc [p2]): UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
-Edit- Important: I updated the code to not use obsoluete functions. Now only the NoSuchDirectoryException issue remains
Edit: NOTE i can bypass the NoSuchDirectoryException by creating the folder in a winform app and copy it. However i still have a LockObtainFailedException issue if i dont shut down properly.I have an issue with (Lucene.net 2.9.2
[https://svn.apache.org/repos/asf/lucene/lucene.net/tags/]. It throws a lock exception. After poking around i notice these things.
My code below works in an app bit when calling in Application_Start i get a NoSuchDirectoryException.Not closing the writer (as my code doesnt do below) i WILL get a LockObtainFailedException with the message
Lock obtain timed out: SimpleFSLock@<FULL_PATH> from either app or asp.net
These thread hinted when spawning threads they get less permissions then i do (but! my main thread has problems as well...) and one solution is to impersonate IIS. I am using visual studios 2010. I am not sure how full blown it is but my attempt to impersonate it failed.
So my question is how do i have lucene create the directory and not throw an exception if dont close the writer for some reason (such as power going out)?
I have page with several textboxes, dropdowns, and check boxes on it. When I click my update button and the update happens, at that point all of the textboxes on the page are locked, I cannot click into any of them. The dropdowns and check boxes still work.
I have a website that show info to all users but if you are logged in you get access to more info and pages then unlogged user does. Can i use some sessions variables and include them in each of the pages ? What is the best way to do this. Also, what is the best way to make user stay logged in, sort of "Remember me" checkbox. Save a cookie on hdd ?
My environment is .Net2.0, VS 2008, Web Application
I need to lock a record when two members are trying to access at the same time.
We can do it in two ways,
By Front end (putting the sessionID and record unique number in the dictionary and keeping it as a static or application variable), we will release when the response is go out of that page, client is not connected, after the post button is clicked and session is out. By backend (record locking in the DB itself - need to study - my team member is looking ).
Is there any others to ways to do and do I need to look at other ways in each and every steps?