asp.net

How do you prevent leading zeros from being stripped when importing an excel doc using c#

I'm able to connect to and read an excel file no problem. But when importing data such as zipcodes that have leading zeros, how do you prevent excel from guessing the datatype and in the process stripping out leading zeros? ...

ASP.Net: How to do pagination with a Repeater?

I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible. I know the Repeater control doesn't have any built-in pagination, so I'll have to make my own. Is there a way to tell the ...

Form post doesn't contain textbox data [ASP.NET C#]

I have several "ASP:TextBox" controls on a form (about 20). When the form loads, the text boxes are populated from a database. The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determined by some business logic). All but 1 of the text boxes work...

What's the best way to deal with cache and the browser back button?

What's the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache that way? ...

Need to test an ajax timeout condition

As the title mentions, I have a timeout callback handler on an ajax call, and I want to be able to test that condition but nothing is coming to mind immediately on ways I can force my application to hit that state, any suggestions? ...

Free ASP.Net and/or CSS Themes

Where can I get some decent looking free ASP.Net or CSS themes? ...

What does an IISReset do?

On IIS 6, what does an IIS Reset do? Please compare to recycling an app pool and stopping and starting an ASP.NET web site. If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site? ...

Reporting Systems for ASP.NET

What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET? ...

Experiences Using ASP.NET MVC Framework

I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework. What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL or something else? I know stackoverflow uses MVC, so p...

Buffer Output

This problem started on a different board, but Dave Ward, who was very prompt and helpful there is also here, so I'd like to pick up here for hopefully the last remaining piece of the puzzle. Basically, I was looking for a way to do constant updates to a web page from a long process. I thought AJAX was the way to go, but Dave has a nice...

Unit testing IHttpModule

How do you unit test a HttpModule in asp.net given that HttpApplication and HttpContext do no implement an interface ? ...

ASP.NET Forms Authorization

I'm working on a website built with pure html and css, and I need a way to restrict access to pages located within particular directories within the site. The solution I came up with was, of course, ASP.Net Forms Authorization. I created the default Visual Studio log in form and set up the users, roles, and access restrictions with Visua...

Filtering out anchor tags in a string

I need to filter out anchor tags in a string. For instance, Check out this site: <a href="http://www.stackoverflow.com"&gt;stackoverflow&lt;/a&gt; I need to be able to filter out the anchor tag to this: Check out this site: http://www.stackoverflow.com That format may not be constant, either. There could be other attributes to the...

Hide a column in ASP.NET Dynamic Data

Hi, Is there any way to apply an attribute to a model file in ASP.NET Dynamic Data to hide the column? For instance, I can currently set the display name of a column like this: [DisplayName("Last name")] public object Last_name { get; set; } Is there a similar way to hide a column? Edit: Many thanks to Christian Hagelid for going t...

Webpart registration error in event log

We created several custom web parts for Sharepoint 2007. They work fine-- however whenever they are loaded, we get an error in the event log saying: "error initializing safe control - Assembly:...". The assembly actually loads fine- Additionally, it is correctly listed in the web.config and GAC. Any ideas about how to stop these (Pha...

What is ASP.NET?

I've been strictly in a C++ environment for years (and specialized statistical languages). Visual Studio until 2001, and Borland since. Mostly specialized desktop applications for clients. I'm not remaining willfully ignorant of it, but over the years when I've dipped into other things, I've spent my time playing around with JavaScript...

Asp.net website first start is very slow

The first time I load the website in the production web server, it start very slow, subsequent pages load very quickly (included the home page). I precompiled the site, but nothing changes. I don't have any code at Application start. I don't have cached items. Any ideas? How can I find out what is happening? ...

asp.net mvc - subfolders

How does the new Microsoft asp.net mvc implementation handle partitioning your application - for example: --index.aspx --about.aspx --contact.aspx --/feature1 --/feature1/subfeature/action --/feature2/subfeature/action I guess what I am trying to say is that it seems everything has to go into the root of the views/controllers folders ...

ASP.Net: Using System.Web.UI.Control.ResolveUrl() in a shared/static function

What is the best way to use ResolveUrl() in a Shared/static function in Asp.Net? My current solution for VB.Net is: Dim x As New System.Web.UI.Control x.ResolveUrl("~/someUrl") Or C#: System.Web.UI.Control x = new System.Web.UI.Control(); x.ResolveUrl("~/someUrl"); But I realize that isn't the best way of calling it. ...

How do you programmatically fill in a form and 'POST' a web page?

Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this? Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit ip, username and email address on their 'add' page. I want to be able to create a link/button on my s...