asp.net-3.5

ASP.NET/IIS: Log out all users

醉酒当歌 提交于 2019-12-10 21:04:12
问题 In an ASP.NET 3.5 application running on IIS, how do I force a "deauthentication" of all currently logged-in and authenticated users? iisreset didn't seem to do the trick! 回答1: ASP.NET authentication is designed to be resilient to an IISReset due to its use of cookies - performing an IISReset will clear any in-memory information, but the next time a user asks for a page on your site, they will send their authentication token, which (if it hasn't timed out) will still be valid, and the server

Code Behing update web.config mapping issue

孤人 提交于 2019-12-10 20:21:51
问题 I from the code behind I need to update my web.config. This has never been a problem before, however I am getting an error recently. The errors say "Failed to map the path '/'." The lines commented out were different variations of what i tried. //Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration(Server.MapPath("~")); //Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration("~"); //Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration

ASP.NET 2.0 TreeView - OnSelectedNodeChanged does not fire in an User Control

时光怂恿深爱的人放手 提交于 2019-12-10 19:32:09
问题 I have a small User Control defined as: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CompanyTree.ascx.cs" Inherits="RivWorks.Web.UserControls.CompanyTree" %> <div class="PrettyTree"> <asp:TreeView runat="server" ID="companyTree" OnSelectedNodeChanged="SelectedNodeChanged" OnAdaptedSelectedNodeChanged="SelectedNodeChanged" > </asp:TreeView> <asp:Label runat="server" ID="currentParentID" Text="" Visible="false" /> <asp:Label runat="server" ID="currentCompanyID" Text="" Visible=

MVC 4 Authorize attribute not recognizing forms auth from ASP.Net 3.5

∥☆過路亽.° 提交于 2019-12-10 18:18:04
问题 I am creating a new MVC 4 app for a client that I had previously created ASP.Net 3.5 (VS 2008) apps for. I created a gateway app to launch several other ASP.Net 3.5 web apps , with the gateway app handling the login and the forms authentication ticket. As long as all of the other web apps have the same settings for the forms authentication and machine key sections all other apps were able to use the forms auth objects to see if the user was authenticated. I am now creating a new MVC 4 app

Windows Workflow Foundation in ASP.NET 3.5 Web Application - Best Approach

这一生的挚爱 提交于 2019-12-10 18:05:15
问题 What is the best way to use Windows Workflow Foundation in ASP.NET 3.5 Web Application. In my case there are several workflows(sequential) which includes numerous steps, user has the privilege to save and exit at any of these steps; the state must be persisted, possibly in SQL Server. Exposing workflows as web service is good idea? I have very little idea about workflows and only tried out wf console applications. Please guide me in right direction, also I would like to know is there any

how to use javascript on AspxGridview

梦想的初衷 提交于 2019-12-10 12:19:36
问题 <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" ClientInstanceName="ASPxGridView1"> <Columns> <dx:GridViewCommandColumn VisibleIndex="0"> <EditButton Visible="True"> </EditButton> <NewButton Visible="True"> </NewButton> <DeleteButton Visible="True"> </DeleteButton> </dx:GridViewCommandColumn> <dx:GridViewDataTextColumn Caption="Content" FieldName="Content" VisibleIndex="1"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="Ratio5%" VisibleIndex="2

ASP.Net 3.5: Specifying a control's HTML ID

妖精的绣舞 提交于 2019-12-10 10:42:32
问题 I have a control which is repeated several times in a page. I'd like each occurrence to have a unique ID which I will define (not the horrible ID asp.net attaches). The problem is that I will only know the ID in run time. I'd like in the .aspx to write the following: <uc8:MyControl ID="<%=THEID%>" runat="server" /> but I know it doesn't work. What's the right way to approach this? Thanks a lot! 回答1: You may add with code: MyControl control = new MyControl(); control.ID == "myControl" + count

When does WCF use app.config or web.config?

╄→гoц情女王★ 提交于 2019-12-10 02:58:23
问题 I am working on a WCF applicaiton. I am very confused about when to use a web.config file and app.config file in WCF client and service. can anyone help me when to use app.config and when to use web.config. 回答1: Is it hosted with IIS? Web.config. Is it hosted as a standalone service? App.config. http://msdn.microsoft.com/en-us/library/ms733932.aspx 回答2: When configuring a service in Visual Studio, use either a Web.config file or an App.config file to specify the settings. The choice of the

ASP.NET Server Control - How to add AssemblyInfo file

风格不统一 提交于 2019-12-10 02:39:12
问题 I've noticed on a few tutorials online that when a new ASP.NET Server Control is added, it automatically includes Properties folder (containing AssemblyInfo.cs) and a References folder. This works fine for me when creating a C# Server Control, but in VB.NET I just get a template .vb file and a Project file. Why is this and how can I get an AssemblyInfo.vb file? 回答1: AssemblyInfo.vb file is created for every project. By default it is not displayed in the Solution/Project Explorer. To view this

Returning a single row

断了今生、忘了曾经 提交于 2019-12-09 14:43:56
问题 I'm trying to return a single row from a database: using (connection = new SqlConnection(ConfigurationManager.AppSettings["connection"])) { using (command = new SqlCommand(@"select top 1 col_1, col_2 from table1", connection)) { connection.Open(); using (reader = command.ExecuteReader()) { reader.Read(); return reader["col_1"]; } } } But I'm getting the following error message: Compiler Error Message: CS0266: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists