webforms

How do you choose between an asp.net webform and mvc application?

This is a difficult question to ask because it's so wide ranging. Does anybody know of a scoring system of questions that would aid in choosing between a WebForms and MVC application at the start of a project? e.g. Is TDD an important part of this project? (If yes score 1 for MVC and 0 for WebForms) ...

Should functionality that's only used once go in a UserControl?

Forgive me if this is a slight mis-use of the system, but I'd like fellow StackOverflow users to settle a debate a colleague and I are having. As a general rule, I prefer each separate item of functionality to be encapsulated within a UserControl even if I know it's only going to be used once. My colleage will eschew creating a UserCon...

DataTable Wrapper or How to decouple UI from Business logic

I am using web forms, C#, Asp.net. As we all know, in this model UI and business logic are often mixed in. How do I separate these effectively? The example I would like to use is: I have a GridView and a DataTable (GridView binds to the DataTable and DataTable is fed from the stored procedure). I would like the GridView (UI) and DataT...

How do you activate the MVC templates in VS2008 from a WebForms App

I'm in the process of adding ASP.NET MVC to a WebForms app. One of the neat features of an ASP.NET MVC solution that you create from scratch is that a right click on the solution explorer and Add > New Item... will give a list of templates which include the MVC templates. However, in a WebForms app these templates don't appear. I though...

Things I cannot do in ASP.NET MVC

Are there some things I cannot do with ASP.NET MVC? Things that are only possible with ASP.NET WebForms, or extremely much easier with WebForms? We consider using ASP.NET MVC for a new project. But I wonder if there are some obvious things we will not be able to do with ASP.NET MVC when compared to WebForms, or places where we will h...

New to web development. Skip WebForms and start with MVC?

I'm an experienced desktop client developer in FoxPro, and I've started learning C# in VS2008 for object oriented programming. At this point, I've never worked on web-based data access apps. In moving to .NET, I want to learn web-based programming rather than desktop client-based, and my focus will be conventional Line Of Business apps. ...

IListSource does not contain any data sources

So what does this exactly means? Some advised that to circumvent around this error, only bind a gridview to a dataset when the rows count of the datatable is greater than zero. but how about if for example your search yielded no record returned, so your datatable would have no rows, but still, you can still bind to the dataset? Aside ...

What are the "gotchas" with ASP.NET MVC versus ASP.NET WebForms?

Related: Practical Application of MVC || When to use, or not use MVC I've recently walked through the entire NerdDinner pdf and sample with the final ASP.NEt MVC build and am thoroughly impressed. Before I start touting it's awesomeness through within our dev group, I'd like to also know what some of the pitfalls or misuses of th...

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error...

I have created a text area that allows users to enter html code. When I attempt to post this code back to the server, I get a popup window that says "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was: 500". I believe this...

Javascript/css/php/mysql to collect user email addresses in a div on a website.

Suppose you want a box on your website that says "Give us your email address and we'll send you news" or somesuch. What's a simple/elegant way to collect those email addresses (assuming a standard LAMP stack)? In particular, I'd like recommendations on Javascript to handle the UI (complain if invalid email address, say thanks when t...

focus in Safari 4 beta selects content

I want to use the defaultfocus property on a form in ASP.Net, and therefore I set this property to a textbox. This works as expected on IE, but in the Safari 4 beta, the content of the textbox is also selected. How can I make this work as expected on Safari? i tried also some jquery call, and the problem is there also: $("input:visib...

How to include a partial view inside a webform

Some site I'm programming is using both ASP.NET MVC and WebForms. I have a partial view and I want to include this inside a webform. The partial view has some code that has to be processed in the server, so using Response.WriteFile don't work. It should work with javascript disabled. How can I do this? ...

Rails: Creating a Multiple Model Form over n association levels

Can anyone tell me why the form at the end of this question isn't working like it should? Save doesn't work The select-helper doesn't select the value according to the object @kid The whole thing is based on Rails 2.2.2 and no, upgrading to Rails 2.3 to solve this problem isn't an option. :-) I used this recipe to build the multiple...

asp.net web-forms commandargument problem

I got a problem with a button control in asp.net webforms. After using mvc a bit i started using foreach in the aspx files in webforms too, instead of repeaters, mostly cause of all the junk viewstate a repeater creates. It works great when you just iterate over html controls. But i got a hard time with button controls. <% foreach (va...

How do you manually databind complex object to templated control like a row in a gridview??

I am struggling with the databinding syntax here. For example I have a data structure like this - public class Course{ public string CourseName {get;set;} public string CourseCode {get;set;} public List<Instructor> InstructorsTeaching{get;set;} } public class Instructor{ public string InstructorName{get;set;} public string Instru...

PHP "implode" error when submitting form

Just noticed I get these errors if I DON'T select a checkbox and submit: Warning: implode() [function.implode]: Invalid arguments passed in /home/content/o/l/t/oltvcb/html/feedback_mtg.php on line 148 Warning: Cannot modify header information - headers already sent by (output started at /home/content/o/l/t/oltvcb/html/feedback_mtg.php:...

Formview and MS-Ajax UpdatePanel

I have an issue with the conditional display of the formview edit button after a partial postback triggered by the formview control. I have an edit button defined in the ItemTemplate like this: <asp:FormView ID="fvGenericDetails" runat="server"> <ItemTemplate> <asp:Button ID="btnEditGenericDetails" runat="server" Visible="fal...

What's your choice for your next ASP.NET project: WebForms or MVC?

Let's say that you will start a new Asp.Net web site/application tomorrow. What your choice between WebForms and MVC, and why? ...

How do I know if a regular for is a postback in ASP.ENT (was Why is IsPostback not set in ASP.NET plain forms)

I am using ASP.NET to process plain forms, posting back to myself. (I dont want to use ASP.NET forms, with runat="server ) To IsPostBack is not set when it really has to be a postback. What is the reason for this? Should I not post back to myself? <form method="post" id="theForm" action="http://localhost/index.aspx"&gt; <input type...

Conditionally excluding a block of html in ASP.NET WebForms

This is just a simple question: how do I exclude a piece of html on an aspx web form from being returned by the server, based on a server-side evaluation? I'm not talking about a control specifically since they tend to have Visible parameters, but rather just some raw html. ...