webforms

How do I run a unit test on a method in a classic ASP.NET project using VS2008?

I just wrote some new utility methods within a non-page class for an existing .NET webforms application and decided to try to unit test using the VS unit test framework rather than testing by hand. I've used the unit test tools before, but only on EXE and MVC projects, and am encountering an error connecting to the WebHostAdapter no mat...

ASP.NET MVC vs WebForms: speed and architecture comparison

I had an argument with one of my friends who is an architect at a pretty large internet company. Basically he was saying that ASP.NET MVC is not for large-scale enterprise applications, that it is not as flexible as WebForms, and that an MVC app will be slower than a web forms app. From my own experience working with MVC, I can say tha...

Trying to check each form input and blank its default value in jquery ajaxform()

I am using the ajaxform() plugin, which so far is working well. However, my input fields have default values, and if the user just submits the untouched form, I need to blank them out before the form is submitted using the beforeSubmit: callback. In nutshell, I don't know the syntax to check the forms input fields and stop the submit i...

Visual Studio 2008 formats asp tags to lowercase

Recently, my Visual Studio 2008(with Resharper 4.5) has started to reformat asp tags into lowercase. Example: <asp:Repeater runat="server" id="rp"> becomes <asp:repeater runat="server" id="rp"> and I can't find a way to make it not do this. I use Ctrl-k Ctrl-d to reformat. I've tried resetting the Visual Studio settings, turning...

Should I always call Page.IsValid in ASP.NET WebForms C#?

I know to never trust user input, since undesirable input could be compromise the application's integrity in some way, be it accidental or intentional; however, is there a case for calling Page.IsValid even when no validation controls are on the page (again, I know its bad practice to be trusting user input by omitting validation)? Does ...

An example of xVal with ASP.NET WebForms?

This is a two part question. Is it possible to take advantage of xVal's automatic client side validation with ASP.NET WebForms? If so, are there any examples available? I imagine that it would be possible to extend xVal to include ASP.NET Validator controls. These controls would be the WebForms equivalent of <%= Html.ClientSideValida...

UpdatePanel in upgraded project vs new 3.5 project

I can get an UpdatePanel control working(partial postbacks) no problem with a new fresh .net 3.5 project. I've overcome many of the pitfalls that are answered here on this site. (scriptmanager on the page, using triggers, or placing the button within the panel itself.) If I have try to use the UpdatePanel on a project that was origi...

Adding unit testing to an existing asp.net web forms application

I have an existing asp.net webforms application that I would like to add some unit testing to but am unsure of exactly how to go about it. The application is database driven with functionality I guess you could compare to an advanced forum. Logic, data access and presentation are seperated for the most part. What methods should I be te...

Treeview validation

The treeview has leaf node checkboxes.I need to validate the treeview if atleast one of the node is checked and not more than a specfic(say 3 nodes) number of nodes a user can select. Note:The Treeview is a asp.net treeview(not an ajax treeview) ...

Javascript Window.Opener Object Null on .NET WebBrowser Control New Window

Well I have a Pop up in the WebBroswer control of the .NET Framework that I capture with the NewWindow event handler like so. WebBrowser w = new WebBrowser(); SHDocVw.WebBrowser_V1 web = (SHDocVw.WebBrowser_V1)w.ActiveXInstance; web.NewWindow += new SHDocVw.DWebBrowserEvents_NewWindowEventHandler(web_NewWindow); The new Popup is in a ...

Suggestions on a very complex ASP.Net input form design?

I am just starting on a complex data entry form and thought I'd ask for input from anyone that may have gone down a similar road before. The form is going to represent a cost estimate (plus additional information) for a project consisting of multiple tasks. All TaskTypes are pre-defined in metadata for a ProjectType, and can consist of...

How to access controls collection of dynamically loaded aspx page?

Let's say I have two webforms, A.aspx and B.aspx, where B.aspx contains some simple web controls such as a textbox and a button. I'm trying to do the following: When A.aspx is requested, I want to dynamically call and load B.aspx into memory and output details of all the controls contained in B.aspx. Here is what I tried in the codebe...

How to implement TDD in ASP.NET WebForms

I know that the reason that Microsoft came out with ASP.NET MVC was to make it simpler to do Test Driven Design (TDD) for ASP.NET. However, I have a rather large brown field (existing) application in ASP.NET WebForms that I would love to implement some TDD type functionality in. I'm assuming that there IS a way to do this, but what are...

formencode invalid return type

if an exception occurs in form encode then what will be the return type?? suppose if(request.POST): formvalidate = ValidationRule() try: new = formvalidate.to_python(request.POST) data = Users1( n_date = new['n_date'], heading = new['heading'], desc = new['desc'], link...

Webforms Routing ignore Elmah

I am having some trouble getting Elmah to work with url routing in an asp.net webforms application. Elmah is mapped to "elmah.aspx" and I have tried a couple of variations on: routes.Add(new Route("elmah.aspx", new StopRoutingHandler())); Is there a way I can ignore all .aspx pages? ...

How to manage that aspx pages load faster?

Hi guys, I have a (big) problem that all of you that work with Webforms might have. The problem is the time to load a page. Using localhost (witch should be the fastest mode) in Vista (IIS 7) I get this graph original file link as you can see, it takes more than 17 seconds to show the page!!! and only 2 seconds to load the page it...

Page contruction times in ASP.NET MVC and WebForms

I want to display at the bottom of my pages a simple "built in x.yz seconds" text, to easily check various options. (some pages are built using parameters entered in a previous page by a "regular" user, who would like too to see the results of his decisions) I know I can use traces in asp.net, but it's not very user-friendly, and I fear...

What is the use of the `CodeFile` attribute in an ASP.NET page

What is the use of the CodeFile attribute in an ASP.NET page ? ...

Drop updating a hiddenfield with an unrelated value

If you wanted to change the value of the hidden field to something not in the value of the dropdown like so <form> <select id="dropdown" name="dropdown" onchange="changeHiddenInput(this)"> <option value="foo">One - 42</option> <option value="bar">Two - 40</option> <option value="wig">Three - 38</option> <...

How to give parameters in the url?

The question raised from the question here. In order to have search engines in Browser, I need to find a way to get the parameters to url. Suppose you have Google Sites where you have Google Gadget. The gadget has a search box. How can you give the search parameters to the search box? ...