global-asax

what is the global.asax Application_Start equivalent when using WAS in IIS7

前提是你 提交于 2019-12-28 03:46:05
问题 I'd like to use the netTcpBinding for my WCF application which is currently hosted in IIS7, which means configuring it to use WAS instead. This is fairly straight forward however, my application previously made use of the Application_Start event in the global.asax file. I do not require access to the httpContext(which I understand access has been removed in IIS7), however I would still like to hook into the start or init methods? Does an equivalent exist when hosting an application in WAS as

URL routing in ASP page

烂漫一生 提交于 2019-12-25 16:53:51
问题 The Actual Address is www.Domain/nav/Default.aspx www.Domain/nav/Fruit/Apple.aspx All I want is to hide the 'nav' and 'aspx' text from address. www.Domain/Default www.Domain/Fruit/Apple I tried some Code in Global.asax file RouteTable.Routes.MapPageRoute("PageRoute", "{0}", "~/{0}.aspx"); RouteTable.Routes.MapPageRoute("PageRoute", "{0}", "~/nav{0}/{0}.aspx"); But its no way working, Can anyone please help me out with the correct code order 来源: https://stackoverflow.com/questions/21826642/url

Application_Start not behaving correctly in ASP.Net 4.0 Application

妖精的绣舞 提交于 2019-12-25 04:04:01
问题 I'm stumped. I ran through all the recommendations on StackOverflow and Google... no joy. My Application_Start method is not behaving correctly in my ASP.Net 4.0 application. I can set Application variables, but not call my logging method. I can set variables: Application["appStartDT"] = DateTime.Now.ToString(); But my logging method is not called: Utilities.writeLog("Application started at: " + System.DateTime.Now.ToString(), 4); This happened about the time I switched from the internal IIS

Redirecting from Global.asax in Medium Trust

倾然丶 夕夏残阳落幕 提交于 2019-12-24 19:23:10
问题 I am attempting to do a redirect in the Application_Error handler in Global.asax. Nothing fancy at all. private void Application_Error(object sender, EventArgs e) { // ...snip... Server.Transfer(somePath, false); // ...snip... } This works great under Full trust, but I need to get it to work under Medium trust. The code I'm working on here needs to function properly in a shared hosting environment (Unfortunately, I have no control over this requirement). However, when I configure the site as

ASP.NET - Log User Session Start/End Times for Audit Trail - Global.ASAX?

喜欢而已 提交于 2019-12-24 14:58:05
问题 My ASP.NET intranet web application uses Windows Authentication, and I would like to record the following details: 1) Windows ID 2) Session Start Time 3) Session Stop Time 4) URL being browsed to (optional) I've got some basic code setup in "Session_Start" method of the Global.ASAX to log session start times (seen below), but that's it so far. I have the feeling this is a primitive approach and there are "better" ways of doing this. So I really have two questions: 1) Is this the right way to

correct me on url routing in mvc

时光毁灭记忆、已成空白 提交于 2019-12-24 05:32:32
问题 In my globas.asax file i have one register route routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Authentication", action = "BigClientLogin", id = UrlParameter.Optional } // Parameter defaults ); and in my action "BigClientLogin" it redirects to a new action called "NewLogin" . So at present my current url looks like "http://localhost:65423/Authentication/NewLogin" .But i need my url in "http://localhost:65423/Login" format. To

Session Start and Session End in Umbraco

点点圈 提交于 2019-12-23 20:39:55
问题 I am using umbraco 7.0 and I need to add some custom code on application start, session start and session end. As for registering events in umbraco we have to inherit from Umbraco.Core.ApplicationEventHandler , I have sone so. But in that we can only override ApplicationStarted and not Session related as we can do in Global.asax. I have seen Global.asax in Umbraco 6 but I can not access Session as shown in that answer if (Session != null && Session.IsNewSession) , maybe it was umbraco 6 and

store List in Global.asax

╄→гoц情女王★ 提交于 2019-12-22 12:34:13
问题 We can store application level strings in a global.asax file like: Global asax: void Application_Start(object sender, EventArgs e) { Application.Lock(); Application["msg"] = ""; Application.UnLock(); } And then in pages we get the "msg" variable as: a.aspx.cs: protected void Page_Load(object sender, EventArgs e) { string msg = (string)Application["msg"]; //manipulating msg.. } However, I want to store List of objects as application level variable instead of string msg. I tried this: Global

Error executing child request for

狂风中的少年 提交于 2019-12-22 10:23:16
问题 In my MVC3 application I'm getting the above mention error when I try to handle a maximum request exceeded error. I'm handling the exception at the application level. I'm trying to redirect to an error page that's located in the Shared folder of the views. I'm using the code below to redirect to an error page if the request size is over the limit. this.Server.ClearError(); this.Server.Transfer("~/Views/Shared/NotAuthorised.cshtml"); This is the error im getting. Error executing child request

Is it possible to remove information from Server Error pages in ASP.NET 4.0?

大憨熊 提交于 2019-12-22 09:56:01
问题 In order to better hide information from users, I'm trying to remove the Version information section from the standard ASP.NET error screen. Custom errors are on, but, under certain circumstances, if you manage to get an error outside of your control (server issues perhaps?) then you can get through to the YSOD. I've tried changing the web.config to include the httpruntime setting where you can set enableVersionHeader to false but the version information still comes through. Also, in the