asp.net

Is cookieless=AutoDetect in forms authentication broken?

Hi, I tried this by disabling cookies in my browser and setting cookieless="AutoDetect" for both the forms element and the sessionState element. however this just doesn't work (what i mean by work is if cookies are enable then the url is unchanged, however if cookies are disabled then the sessionid is added to the querystring as per msd...

GridView paging changing. Capture on postback

On a page_load() , Is there a way of capturing that a paging value has been changed? (e.g.from page 1 to page 2) This relates to a Gridview control ...

How to refresh xml cache after one day from the last modified date??

Hi, I am developing a web app using ASP.NET 2.0 (C#), where on home page I am displaying recently added records. Adding of records frequency is around 1-5 records per day, so I decided not to put much overhead on the sql server by fetching recent records every time from db server. So, To make the data cached I have used XML files, I h...

Should I Refactor This Code?

I am working on modifying a control on a existing site. All controls from the site inherit form a base class. I have a requirement to hide several links on the master page so I wrote this method on my control: private void HideCartLink (bool visible) { Control control1 = Page.Master.FindControl( "link1" ); control1.Visible = visib...

Rewriting URLs in ASP.NET?

I am using ASP.NET C#. How do I implement URL re-writing procedure that is similar to StackOverflow.com? http://stackoverflow.com/questions/358630/how-to-search-date-in-sql Also, what is the meaning of values such as "358630" in the URL? Is this the question ID (the basis for which they use to fetch the data from the table)? Whatever...

Databound drop down list - initial value.

How do I set the initial value of a databound drop down list in ASP.NET? For instance, I want the values, but the first value to display should be -- Select One ---, with a null value. ...

From WebForms to ASP.NET MVC

This question is for anyone who has significant experience using ASP.NET WebForms who has made the switch to ASP.NET MVC. What was your business justification for making the switch? Do you consider the MVC platform to be mature? How long did it take for you to be productive using MVC (say 80% of your previous WebForms productivity leve...

Response.Redirect vs. Server.Transfer

Which is better, Response.Redirect or Server.Transfer in ASP.NET ? ...

Active Directory Security Group and Role in asp.net

I have a security group in AD. I want to assign Administrator role to members of that security group. What is the best way to do it? ...

Unable to get ASP.Net UpdateProgress to display

I'm trying to display an update progress loading image whenever my update panel does it's Ajax thing. I've looked around at tutorials and it seems really straightforward but I'm having no luck. Here is pretty much what I have... <div id="panelWrapper"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <Co...

MSBuild error while compiling ASP.NET website

I get the following error when I try to compile an asp.net site using a custom build script. error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Although the descrip...

Programmatically adding Javascript File to User Control in .net

How do you add Javascript file programmatically to the user control? I want the user control to be a complete package - ie I don't want to have to add javascript that's related to the user control on the page where it's used, when I can do it inside the control itself. Since there is no Page object in the user control, how would you do...

looking for automated modeling tool for ASP.Net class diagramming

I'm walking into a project with 500+ classes, and am wondering if anyone has had good experiences with automated modeling tools that can import from ASP.Net /C#? It would be a bonus if I could get an automated model based on all the objects called to completely load a single ASP.Net page, with relationships indicating which objects are ...

How to redirect with "www" URL's to without "www" URL's or vice-versa ?

Hi, I am using ASP.NET 2.0 C#. I want to redirect all request for my web app with "www" to without "www" www.example.com to example.com Or example.com to www.example.com Stackoverflow.com is already doing this, I know there is a premade mechanism in PHP (.htaccess) file. But how to do it in asp.net ? Thanks ...

Button click event

I have several instances of user controls on a page. They are also nested in each other. Since these controls are created dynamically, I am having trouble maintaining their state. I decided to save the state manually to a persistent medium (possibly Session). On the click event on a button on the host page, I want to write functionality...

DataGridView Autogeneratecolumns as TextBox instead of label

How can I have a datagridview that will autogenerate a textbox instead of a label? ...

Can you prevent LinqDataSource from setting a property?

I've got a Linq 2 SQL object I'm trying to update. Two of the properties on this object are related to each other, and setting one sets the other. So if I do: Foo.Code = BEER; The Foo.CodeID property will automatically be set to 5 (or whatever.) The problem is that LinqDataSource sets Foo.Code, then immediately sets Foo.CodeID... wh...

what is the best way to verify if a website is working

I'm thinking to add some code on the server side in asp.net, to verify if the website is working before redirect to it. thanks. ...

ASP.net: Does anyone know how to implement youtube search box like effect?

When the search text box on youtube have focus on it, it is sort of highlighted with blue color around the text box. I'll like to implement that kind of effect on my web app. does anyone know how that's done or something similar? Jack ...

What assembly are ASP.NET UserControls put into?

Classes I create in ~/App_Code are put into the App_Code assembly. If I create the following ASP.NET UserControl: ~/UserControls/BasicUserControl.ascx <%@ Control Language="C#" AutoEventWireup="true" CodeFile="BasicUserControl.ascx.cs" Inherits="UserControl_BasicUserControl" %> Hello world! ~/UserControls/BasicUserControl.ascx.cs u...