asp.net-2.0

How to configure the timeout of your ASP.NET web application?

独自空忆成欢 提交于 2020-01-15 13:25:50
问题 My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two? Any help is highly appreciated, thanks in advance. 回答1: You can set the Sesion timeout in your web.config file. <sessionState timeout="60" /> The value is defined in minutes. I think you can set it programmatically as well from the HttpContext.Current

How to configure the timeout of your ASP.NET web application?

ⅰ亾dé卋堺 提交于 2020-01-15 13:23:18
问题 My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two? Any help is highly appreciated, thanks in advance. 回答1: You can set the Sesion timeout in your web.config file. <sessionState timeout="60" /> The value is defined in minutes. I think you can set it programmatically as well from the HttpContext.Current

Run long-running sproc (that doesn't need to return) from ASP.NET page

时间秒杀一切 提交于 2020-01-15 10:44:26
问题 I would like to know how you would run a stored procedure from a page and just "let it finish" even if the page is closed. It doesn't need to return any data. 回答1: A database-centric option would be: Create a table that will contain a list (or queue) of long-running jobs to be performed. Have the application add an entry to the queue if, when, and as desired. That's all it does; once logged and entered, no web session or state data need be maintained. Have a SQL Agent job configured to check

ASP.NET “Controls cannot be modified [because it contains code blocks]…” error on one server but not another

一曲冷凌霜 提交于 2020-01-14 04:23:50
问题 I've got a web app that works on my local computer and our test server but is failing in production with this error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). I've read in a couple places that this can be fixed by changing <%=...%> to <%#...%> , but it intrigues me that the error comes up only in production. What differences in configuration could be causing this? Complete stack trace (note that it includes the Ajax Toolkit): System

Whats the quickest way to dedupe a querystring in C# (ASP.net)

前提是你 提交于 2020-01-13 04:52:05
问题 I have an issue whereby the company uses a business tracking system that captures a users first visit and redirects them to the page they were trying to visit but with a refferer URL attached... Now as the referer URL carries the url that the person was trying to visit (dont ask why, Ive no idea) it causes me to have a duplicate of every value. So visiting this... home.aspx?test=test&test2=test2 becomes home.aspx?test=test&test2=test2&referrerurl=home.aspx?test=test&test2=test2 Now, URL

How can I use CompareValidator for times without dates?

妖精的绣舞 提交于 2020-01-09 11:41:37
问题 When I enter 9:00 into the Start control, and 16:00 into Finish; the code below fails validation. Does anybody know a way I can use the ASP.NET validator for times without the dates? Start <asp:TextBox ID="txtStart" runat="server" /> (hh:mm) <br /> Finish <asp:TextBox ID="txtFinish" runat="server" /> (hh:mm) <br /> <asp:CompareValidator id="cpvFinish" ControlToValidate="txtFinish" ControlToCompare="txtStart" Operator="GreaterThanEqual" Type="Date" Display="Static" EnableClientScript="true"

Setting ViewStateUserKey gives me a “Validation of viewstate MAC failed” error

南楼画角 提交于 2020-01-09 07:41:26
问题 I have the following in my BasePage class which all my ASPX pages derive from: protected override void OnInit(EventArgs e) { base.OnInit(e); ViewStateUserKey = Session.SessionID; } I also have a machineKey set in Web.config . I don't think this error is because of a web farm because this happens on my dev machine too. My host has now upgraded to .NET 3.5 SP1. After this update, everytime I compile with the ViewStateUserKey setting above, I constantly get the "Validation of viewstate MAC

ASP.Net — <select> items not being posted back after jQuery populates list

放肆的年华 提交于 2020-01-03 16:56:27
问题 I have an ASP.Net ListBox that I'm trying to populate via jQuery, using the following snippet: $("#MyList_btnAddAll").click(function(e) { e.preventDefault(); $('#MyList_lstAll option').appendTo('#MyList_lstSelected'); }); The code has two ListBoxes in fact, one a "source" and the other a "destination". As you can tell above the ListBoxes are MyList_lstAll and MyList_lstSelected. These are rendered in the browser as elements, as you'd expect. The jQuery is working great, the items are moving

RequiredFieldValidator client side validations do not work on IE 10

ぐ巨炮叔叔 提交于 2020-01-03 01:21:47
问题 All my webforms using RequiredFieldValidator, RegularExpressionValidator and ValidationSummary are not working on IE 10. It is working fine on any other browsers. It is strangely doing postback which does not happen on any other browsers. Another strange thing is when I open developer console(F12), it seems to be working but it is still doing postback. All these Validations should occur at client side by default. Has anyone here faced similar problem? 回答1: please check these link1 and link2

How to: Cross-Site posting and redirection in ASP.NET webforms

限于喜欢 提交于 2020-01-02 23:09:20
问题 Scenario: The task I have at hand is to enable a single-signon solution between different organizations/websites. I start as an authenticated user on one organization's website, convert specific information into an Xml document, encrypt the document with triple des, and send that over as a post variable to the second organizations login page. Question: Once I have my xml data packaged, how do I programmatically perform a post to the second website and have the user's browser redirected to the