asp.net

When's the absolute latest you can call Page.ClientScript.RegisterClientScriptBlock?

I need to output some JavaScript in a WebControl based on some processing and some properties that the consumer can set, doing it on the load of the page will be to early. When is the latest I can call RegisterClientScriptBlock and still have it output on the page? ...

best way to consume a webservice in an asp.net code behind

Hello, I'm trying to bind a datasource to a repeater, for instance, to a web service (.asmx from a different website) on page load. The webservice returns a DataSet from an sql call. What is the best way to go about doing this? ...

How to test custom Model Binders in ASP.NET MVC?

I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm wondering what is a good approach to unittest them (binders)? ...

Best way to store previous search criteria in ASP.NET

I have a web application that allows a user to search on some criteria, select an object, edit it and then return to the previous search. All the editing takes place on a separate page linked to the datagrid of returned results. I was wondering what is the best way to store the previous search parameters so that when they return to the...

How do I remove fields from a web form using ASP?

I have a web page that has a web form for signing up. I want to remove fields. I've tried removing the field code from the .asp file but obviously there are other things that I need to remove along those lines. I have full access to all the code but I need help knowing where things are linked as far as making the form work again. Our pro...

What's the fastest track to learning to build enterprise ASP.NET v3.5 apps?

Having not done ASP.NET since v1.1, and now blitzing through the Wrox Pro ASP.NET v3.5 book, what other resources are available to get me developing enterprise ASP.NET apps the fastest? I've been developing in DotNet since Beta and have been doing Winform & middle-layer architecture/design/dev for 3.5 years now (as this has been my clie...

ListView - Can you set DataKeyNames when binding to a simple scalar array?

I have a case that keeps coming up where I'm using a ListView or similar control with a simple array such as string[]. Is there a way to use the DataKeyNames property when you are binding to simple collections? ...

Recursive control search with Linq

If I wanted to find checked check boxes on an ASP.NET page I could use the following Linq. var checkBoxes = this.Controls .OfType<CheckBox>() .TakeWhile<CheckBox>(cb => cb.Checked); That works fine if the checkboxes are nested in the current control collection, but I'd like to know how to exte...

Where is the .asmx after I added a localhost webservice?

When I added service -> web service. The VS2008 added a App_WebReferences folder without a .asmx file. I see a .discomap file. When I use the cascading drop down ajax control, it is looking for .asmx in the service path. Am I doing it wrong? I remember the early edition of Visual Studio added a .asmx file when you added a outside webse...

How to run an ASP.NET application with verbose debug messages of the ASP.NET runtime

How do I configure an ASP.NET application to write verbose log messages of what ASP.NET engine itself is doing. What I get with <trace enabled="true" pageOutput="false" requestLimit="10000" writeToDiagnosticsTrace="true"/> is just as much as [2488] aspx.page: Begin PreInit [2488] aspx.page: End PreInit [...

ASP.NET Grid with frozen columns

I need a grid that will allow me to freeze a column (the Ms Excel style). I do not need to freeze rows. Of course the Asp.net 2.o Gridview does not supports this out of the box. I am sure someone has had a similar requirement and had a way foward. Please advise any options available with the Gridview. I am also open to using any third...

One gridview - two datasources?

I am working on a co-workers website, and he mistakenly put up a gridview that shows a TypeID instead of the TypeName. I want to put the actual NAME of the type, instead of it's arbitrary ID number, like he has it. I see he has two "ObjectDataSource"'s on the page -- one for Type and one for Item. Items contains the ID of what TYPE th...

'License expired' error when dynamically generating Excel docs in ASP.NET

Anyone familiar with error below? When I run my webapp to generate a dynamic excel doc from my local machine it works fine but when the same piece of code is invoked on the server I get the below error. It seems like it's a permissions issues since it works on my machine but not the server but I don't know where to start in order to pinp...

Global.asax called dozens of times/second by same IP

I noticed in my custom application log that I had 600 requests to Global.asax within a few minutes, while no other users were using the application. They all came from an IP address of a known application user, so I don't think it's an attack of any kind. I generate log entires in a custom SQL Server database at the entrance of every pub...

How do I prevent exceptions from half-loaded pages' form submission while using asp.net event validation?

I have a page with some dynamically added buttons. If you click a button before the page has fully loaded, it throws the classic exception: Invalid postback or callback argument. Event validation is enabled using in configuration or in a page. For security purposes, this feature verifies that arguments to postback or ...

ASP.NET Image uploading with Resizing

I have an aspx page which will upload images to server harddisk from client pc But now i need to change my program in such a way that it would allow me to resize the image while uploading. Does anyone has any idea on this ? I couldnt not find such properties/methods with Input file server control Any one there to guide me ? ...

OpenId development while disconnected from Internet

What solutions have people come up with to develop their web applications offline when they made the decision to use OpenId for site membership? Couple of ideas: Create two login pages one for OpenId and one for ASP.NET Membership Create local OpenId provider with test accounts Any thoughts? ...

Server-side commenting in asp.net (HTML side)

I need to leave some instructional comments for other developers on a page/user control. Is there a better way to do this besides the below? <% /* DO NOT rename control IDs here, because blah blah blah... */ %> ...

weird Page.Response.Redirect problem

I have a login page where I authenticate the user. When the authentication pass, I then redirect the user to another page via Response.Redirect with the url defined in login control's destinationpageurl. It work fine in firefox but when i test it with IE. It just redirect the user back to the login page. does anyone know what's going o...

PostbackUrl vs NavigateUrl

Can someone tell me the different between LinkButton.PostBackUrl and HyperLink.NavigateUrl? I've got a asp.net 2.0 application that uses both methods throughout the application and everything works fine. However if I connect to the application over the company vpn all of the links that use LinkButton.PostBackUrl give me a (54) Connecti...