asp.net

Authorization Asp.net web.config

I have an application that has a backoffice. This backoffice was isolated with the use of roles like this: <location path="backoffice"> <system.web> <authorization> <allow roles="admin"/> <deny users="*"/> </authorization> </system.web> </location> But now we have another type of role that needs access. T...

ASP.NET MVC - Reasons to begin

Hi, I'm thinking about going into the ASP.NET MVC scene. I've seen the videos at http://asp.net/learn, but they havn't impressed me. So can you answer me, what makes MVC "so impressive", and why does it make life better and easier? ...

Client-Side validation with groups

I have several tabs that are loaded via ajax, and each one has a set of validators. I want to allow the user to change tabs only if the tab is valid I thought setting a validationgroup to the validators and then check for the specific group like this, would work: function validatePage(group) { return Page_ClientValidate(group); } ...

Session item comes back after being removed.

I remove an item from the session using Session.Remove(), then redirect to another page. If I click back, then reload, the item is suddenly back in the session. Shouldn't Session.Remove() take it out of the session for good? ...

Forms Authentication...

I've been programming for a long time now, but I'm not the world's most experienced.Net developer. I recently picked up a project that is using Forms authentication for their website. I first looked at forms authentication in .Net 1.1 and at that time it had some limitations that made me decide not to use it as my primary form of authe...

When publishing an ASP.NET application, should I change the build type to Release in the Visual Studio Configuration Manager?

For my production sites I usually change the "debug" flag in the Web.Config to "false". But I always publish my sites with the Configuration Manager set to "Debug". Should I change this setting too? ...

Faking browser request in ASP.net C#

I'm using the code below to pull one of our 3rd party developed pages in so I can parse it as XML for my random bits of work. Irritatingly we stil have a browser detection level set on the server that only allows certain browsers on to the site; so the question is how would I fake it so that the server thinks its a browser request? ...

storing timestamp to session and counting time difference causes issues

I am counting how many seconds it takes to go from aspx page 1 to page 2. This time is not reflecting a real clock.. Where is the bug? on page 1 I have: Session("sessioncreated") = Now.Ticks on page 2 I have: Dim diff As Long = 0 If Not Session("sessioncreated") Is Nothing Then diff = Now.Ticks - Session("sessioncreated") End I...

Prevent visitors from opening certain pages

I have as ASP.Net 2.0 website with SQL Server as database and C# 2005 as the programming language. The website is almost complete and all the links are working fine. But I want to prevent normal users from opening a couple of pages. When any user clicks on those specific links, another page opens which contains a ASP Login control. The u...

Get current row color in TemplateField?

I have a situation where I need to know the current color of an alternating row in a TemplateField of a GridView. UPDATED: How do I retrieve this Color value in a <%# ??? %>. (Or an workaround where I get the row number). ...

IIS7 Cache-Control

I'm trying to do something which I thought would be fairly simple. Get IIS 7 to tell clients they can cache all images on my site for a certain amount of time, let's say 24 hours. I have tried the step on http://www.galcho.com/Blog/PermaLink.aspx?guid=490f3c31-1815-40fc-a871-5d6899fa35e0 but to no avail. I still get requests going to...

Is it possible to determine if the client has a certain ActiveX control installed?

I have an ASP.Net website that pushes image files to the client. Due to wacky needs from our diverse user-base, some client workstations have an ActiveX component that they need to use in this website to manipulate this image, but due to cost, not all users have this control. What I'd like to be able to do is determine if the client ha...

How do you pass a another control into a user-created ASP.NET control as a parameter in its decleration using the ID of the other control?

I'm trying to create a control (MyControl) which does things to other controls on the page it's on. It has a property: public property System.Web.UI.Control SomeOtherControl; I want to be able to set this property from the ASPX page that uses the control. Right now, the only way I can do it is in the Page_Load of the code-behind: MyC...

ViewState and dynamicly removed controls

A ASP.NET page's ViewState seems to have troubles keeping up with dynamicly removed controls and the values in them. Let's take the following code as an example: ASPX: <form id="form1" runat="server"> <div> <asp:Panel runat="server" ID="controls" /> </div> </form> CS: protected void Page_Init(object sender, EventArgs e) { B...

Can a page raise an event that the user control can handle?

I have done this the other way many times as it makes sense (the page knows about the control as it has been added to the page and can handle the 'child' event) Is it possible to do it the other way? I think not as the control doesn't know what page it is going to be on The reason i ask this is that I have a modal popup on the page to...

what is the built-in javascript function to return the validator state in asp.net

This is a bit of a tough question to ask. I am using asp.net validators, but I want to tie them to a simple click event which I bind with jQuery. I have found that I can use: ValidatorValidate($("#<%= rfvFirst.ClientID %>")[0]); to fire the rfvFirst validator, but I do not know how to get the actual false return somewhere to tell me...

GridView Paging inside a repeater

Hi , I have a greidview nested within a repeater , And trying to enable paging on th e grid view without much success. the gridview databound is like this <asp:repeater....> <asp:gridview id="GridView1" Datasource='<%# LoadData(CInt(Eval("Id"))) %>' OnPageIndexChanging="GridViewPageIndexChanging" AllowPaging="true" Pag...

DB Connection Pool Size Reasonable Limit?

Our pool size is set to 600 connections for our web app to our database. However I just got an email from the client saying they are pushing our training course to 4000+ users telling them that they should get it completed by the 27th of this month. Should I up it to 4000? ...

CSS Friendly Control Adapters causes security error?

I just added a reference to the CSS Friendly Control Adapters dll and added the following file (CSSFriendlyAdapters.browser) to my "App_Browsers" folder: <browsers> <browser refID="Default"> <controlAdapters> <adapter controlType="System.Web.UI.WebControls.TreeView" adapterType="CSSFriendly.TreeViewAdapter" />...

ASP MVC routing problem with IIS7

We discovered problem when deploying MVC application on IIS7 server: any route navigation gives 404 error. I've found on web that problem can be solved by setting application pool managed pipeline mode to integrated, but now we have exception: Request is not available in this context Description: An unhandled exception occurred during ...