asp.net-2.0

Asp.net session expiry redirect to login page

 ̄綄美尐妖づ 提交于 2019-12-18 07:15:15
问题 What is the best way to redirect to the login page when the session expires. I'm using sessionState mode="InProc" Can I set this in the web.config file? 回答1: The trick to remember about the session expiration is that this happens in the the worker process running behind the scenes and there is no direct way to notify the user without going back to the server to check the state of things. What I do is I have the page register a Javascript block that will redirect the user to the login page

Asp.net session expiry redirect to login page

﹥>﹥吖頭↗ 提交于 2019-12-18 07:15:04
问题 What is the best way to redirect to the login page when the session expires. I'm using sessionState mode="InProc" Can I set this in the web.config file? 回答1: The trick to remember about the session expiration is that this happens in the the worker process running behind the scenes and there is no direct way to notify the user without going back to the server to check the state of things. What I do is I have the page register a Javascript block that will redirect the user to the login page

Limiting view state information on AJAX calls

删除回忆录丶 提交于 2019-12-18 06:57:40
问题 I have an Entry Form and a GridView on the same page. Selecting a row from the GridView populates the TextBoxes in the Entry Form above it with all the entries of the GridView row. When this page opens and any row is selected from the GridView, I could see a lot of View State data being sent to the server with each AJAX request. I selected View Source option of the browser to check this. I tried disabling the View State on top of the page by using: EnableViewState = "false", but my

How to Deploy/Publish an ASP.NET website?

萝らか妹 提交于 2019-12-18 02:46:06
问题 Is there any easy way to Deploy/Publish a website written in asp.net ? And what is the difference between deploy and publish ? 回答1: Here is a site that shows different techniques how to accomplish this task. There are many techniques that can be utilized as a deployment strategy for your web application.: Beansoftware How to Deploy ASP.NET Web Application 回答2: Alt + B + H combination (opens publish window for ASP.NET web site / application) is the most simple way to deploy an application to

How to make a website secured with https

拜拜、爱过 提交于 2019-12-17 21:38:54
问题 I have to build a small webapp for a company to maintain their business data... Only those within the company will be using it, but we are planning to host it in public domain, so that the employees can connect to app from various locations. (Till now I have built web apps that are hosted internally only) I'm wondering whether I need to use a secured connection (https) or just the forms authentication is enough. If you say https, I have some questions : What should I do to prepare my website

How do you get around multiple database connections inside a TransactionScope if MSDTC is disabled?

北慕城南 提交于 2019-12-17 18:59:21
问题 I have a web application that issues requests to 3 databases in the DAL. I'm writing some integration tests to make sure that the overall functionality round trip actually does what i expect it to do. This is completely separate from my unit tests, just fyi. The way I was intending to write these tests were something to the effect of this [Test] public void WorkflowExampleTest() { (using var transaction = new TransactionScope()) { Presenter.ProcessWorkflow(); } } The Presenter in this case

How to generate an 401 error programmatically in an ASP.NET page

巧了我就是萌 提交于 2019-12-17 17:41:14
问题 As you can see this is a question from a non web developer. I would like to have an ASPX page which, under certain circumstances, can generate a 401 error from code. Ideally it would show the IIS standard page. 回答1: Set Response.StatusCode and then - if you need to stop execution - call Response.End(). 回答2: Response.StatusCode = 401; Response.End(); 回答3: I think I still prefer: throw new HttpException(401, "Auth Failed") I don't think the Response.StatusCode method triggers custom errors

How does one discard a session variable while closing Web Page?

自闭症网瘾萝莉.ら 提交于 2019-12-13 17:06:51
问题 We are following a procedure in our work while developing a web page, is to bind page to one or more session variables, these session variables are used only for that page, to hold current processing objects, so while closing page no need for them. How could I discard these session variables while closing page? Any suggestions regarding that technique or how to solve that problem? 回答1: There is no server-side event that is raised when a page is left/closed. Also the Session_End event

With Web projects Asp.Net only detects changes in aspx, but not cs files

╄→尐↘猪︶ㄣ 提交于 2019-12-13 03:28:51
问题 Q1 - Asp.Net is able to detect when you change the original files and automatically recompilles the application when next request arrives A) But it appears that while with Web sites Asp.Net is able to detect changes, regardless of whether they happen in code-behind file (.cs) or in aspx file, with Web projects Asp.Net only detects changes that happen inside aspx file, but it doesn’t detect changes inside .cs files! Why is that? B) Asp.Net also detects if any new aspx or cs files were added to

How do I set minumum password requirements in Umbraco for the membership provider?

删除回忆录丶 提交于 2019-12-12 19:07:37
问题 I am trying to set minimum password requirements for my membership provider in Umbraco. Currently my web.config membership section looks like this: <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15"> <providers> <clear /> <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat