asp.net

Why are request cookie poperties null or incorrect on ASP.NET postback?

I'm debugging the HttpContext.Current.Request.Cookie values in an ASP.NET web application, and finding the only property correctly populated is the Value. The Domain and Path are null, and the Expires value is set to DateTime.Min. ...

ASP.NET CSS on PostBack in IE 7 Not Working

When My ASP.NET page does a postback in IE7, all the CSS is lost. I am not using Themes and are including the CSS from the Masterpage in code behind. protected override void OnLoad(EventArgs e) { base.OnLoad(e); AddStylesheetInclude("/static/css/global.css"); AddStylesheetInclude("/static/css/sifr.css"); } And my code ...

ASP.NET Membership Issues With Registration

I'm having a rough time with this membership stuff. OK, so, it's really odd. I can register a user. I can register, I can login. However, when I go to register ANOTHER user the user isn't saved in the database and I get a Membership credential verification failed event when the user tries to login (I assume because the user is never b...

Why won't my ASP.NET CustomValidator validate?

I must be doing something wrong. I can't seem to execute my CustomValidator's ServerValidate method. I've got a Visual Basic ASP.NET page with a CustomValidator... <asp:TextBox ID="TextBox1" runat="server" /> <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="Friendly message g...

How to prevent repeated postbacks from confusing my business layer

I have a web application (ASP.Net 3.5) with a conventional 3 layer design. If the user clicks a button a postback happens, some middle and data layer code runs, and the screen is refreshed. If the user clicks the button multiple times before the first postback is completed my logic gets confused and the app can end up in an invalid state...

Asp.Net OutputCache and Expiration

I am using the Asp.net OutputCache on a page containing a usercontrol that in certain circumstances when the usercontrol is edited i want to be able to expire the page cache and reload the page with fresh data. Is there any way i can do this from within the usercontrol? If not, what are some other methods of caching the page that will ...

Does System.Web.Caching.Cache make sense in an ASP.Net MVC app?

Since there is no concept of sessions in ASP.Net MVC and each request is independent of each other would I ever make use of the Cache object to internally cache data in order to minimize db access? The output caching functionality is great for caching view data but if I wanted to cache something like a user profile which should be shared...

NET: Best Practices/guidelines for dividing namespaces between files?

What should be the general guidelines/gotchas for dividing application code (App_Code) into separate files? I've found that over time, the original files do not match up well with how the namespace hierarchy evolves. How do I keep application code containers organized intuitively over time? What PURPOSE should the file divisions aim t...

asp.net mvc : Ajax actionlink or Jquery solution?

Im trying to change images on click similar to what SO does with the vote arrows and checkmark. Im thinking either to : 1- Have each image be an Ajax.ActionLink and return a different image when clicked. 2- Have the images be the background of a Hyperlink and use Ajax.ActionLink to replace the css class to get a new image. 3- Use JQ...

Best way for users to import to a database?

I know this isn't a unique issue but I've not had much luck finding examples of how others have addressed this issue. I have an intranet asp.net application I have inherited and am building upon. One particular page is for data entry to submit a claim for approval and we have a form where one record at a time can be entered and it is val...

Why would my ASP.NET project run on the development server when not among the startup projects?

I have a visual studio 2008 solution that includes an asp.net-hosted remoting project in c#. The solution also contains other c# projects and c++ projects. When debugging the interaction between my c# client and the asp.net server, the debugging is great. I can literally step into server calls and back out. However, there are times in ...

Castle ActiveRecord, Web Project, and the Bin folder

Which assemblies are necessary to add to the Bin folder for ASP.NET 3.5 project that is going to use Castle ActiveRecord? Is it: Castle.ActiveRecord.dll Castle.Core.dll Iesi.Collections.dll NHibernate.dll log4net.dll What else is needed? ...

How to build a kind of firewall.

Actually what i am trying to build is like a kind of firewall. It should be able to get to know all the requests going from my machine. It should be able to stop selected ones. I am not sure how to even start about with this. I am having VS 2008/2005 with framework 2.0. Please let me know if there is any particular class i can start with...

asp.net what to use instead of viewstate

Currently I am using the viewstate just to store the current page number I am on while paging through data. I have 3 controls on the page that have data I can page through. So far the easiest way to keep track of the page number is the viewstate but it's getting really big and I have no idea why. So I would like to use something else t...

customize asp.net membership by changing "userid" type to integer

in asp.net membership is it possible to change the "userid" type from "uniqueidentifier" to "integer"? and how to do it? ...

.NET automated build with cruisecontrol.net + nant - multiple assembly structure / best practice

Hi, I'm doing some work with several shared .NET assemblies and a generic web application that I would like to handle better in our CC.NET/NAnt build environment. Currently, we have several .NET assemblies (shared common code that we use in client projects) that exist in different .NET solutions within different repositories in our SCM...

What options are there to find out if my ASP.NET MVC view is not XHTML compliant

Clarification: Thanks for the suggestions of tools for validating XHTML. I'm primarily looking for a solution that will run server side (or on the client with jQuery) so i can set it and forget it during development - and get told when I have issues without having to run a tool all the time. All this tag soup stuff scares me with ASP...

Calling a Webservice with ASP.NET AJAX Clientside-only Script from a ASP.NET MVC App?

hi, i am looking for a basic example that shows how i could call a webservice with the client side javascript that comes with the ASP.NET Ajax Toolkit. i already found some example that shows how you do it with ASP.NET WebForms but i am using ASP.NET MVC so no fancy ScriptManager for me :( does somebody know a insightful blog posting ...

How to Update a XML Node?

It is easy to read an XML file and get the exact Node Text, but how do I Update that Node with a new value? To read: public static String GetSettings(SettingsType type, SectionType section) { XmlTextReader reader = new XmlTextReader(HttpContext.Current.Request.MapPath(APPSETTINGSPATH)); XmlDocument document = new XmlDocument();...

asp.net crosspage postback on click doesn't run

I am trying to get a crosspage postback to work in asp.net 2.0 the issue I seem to be having is the button that I press is meant to use it's on click event to store some session variables based on the values of other controls. This button has crosspage postback property to the relevant page. The on click event seems to not run at all, i...