webforms

Totally Dynamic Form Creation: MVC or WebForms?

I'll start a new project, that will include forms whose inputs and their types (textbox, checkbox etc), Validation rules are defined in DB. I have to choose one of the frameworks for Form Creation, Form Validation, Edit/Insert Forms but I'm stuck. I doubt MVC will make handling Parent-Child relationship for Controls difficult. And altho...

Sorting a gridview when databinding a collection or list of objects

I am attemping to have my gridview be: bound by a List in code-behind. I am using my own custom BOL. no datasource object on the html page sortable on each column that I choose. The SortExpressions are all set correctly. The resulting error message: The GridView 'myGridView' fired event Sorting which wasn't handled. How can I have...

Custom attributes in ASP.NET web forms HTML tag

I am using ASP.NET webforms on the .NET 3.5 framework. How can I achieve a custom attribute in the HTML tag such as: <HTML lang="en"> I want to achieve this in the code behind on a common inherited base page. The attribute value would dynamically set based on a session value everytime a page is loaded. Late addition: I want to achiev...

Find a control in a webform

I have a Web content form and need to access a control inside the content panel. I know of two ways to access the control: 1 : TextBox txt = (TextBox)Page.Controls[0].Controls[3].Controls[48].Controls[6] 2 : By writing a recursive function that searches through all controls. Is there any other easier way, since Page.FindControl doesn't ...

jQuery Validation plugin in ASP.NET Web Forms

I would really like use the jQuery Validation plugin in my ASP.NET Web Forms application (not MVC). I find it easier than adding asp validators everywhere and setting the control to validate field on all of them. I am just having some issues both when setting the class like this class="required email" which I think has something to do...

url rewriting + Asp.Net Login Form = Death

Hi, on our site we do url rewriting to generate massive amounts of database generated pages. on every page, there is a Login control for users. like this: Internal aspx page: /DB.aspx?id=123 User visible url: /ABC/123.aspx, /ABC/456.aspx ... (url rewritten) unfortunately, the tag on each page has an action attribute of "DB.aspx?id=123...

Checkboxes on Rails

What's the correct way of making checkboxes that are related to a certain question in Ruby on Rails? At the moment I have: <div class="form_row"> <label for="features[]">Features:</label> <br><%= check_box_tag 'features[]', 'scenarios' %> Scenarios <br><%= check_box_tag 'features[]', 'role_profiles' %> Role profiles <br>...

Where should "Master Page" logic go in MVC?

I'm experimenting with MVC, and my question is - where I had Page_Load logic in Master Pages with WebForms, where should it go in MVC? Here's the business case: Different Host Headers should cause different Page Titles to be displayed on the site's (one) Master Page, therefore all pages. For example, if the host header is hello.mydomai...

Rails 'params' variable

In reference to this I've created a question in a webform like this: <div class="form_row"> <label for="features[]">Features:</label> <% [ 'scenarios', 'role_profiles', 'private_messages', 'polls' ].each do |feature| %> <br><%= check_box_tag 'features[]', feature, (params[:features] || {}).in...

Radio buttons on Rails

Similar to this question: http://stackoverflow.com/questions/621340/checkboxes-on-rails What's the correct way of making radio buttons that are related to a certain question in Ruby on Rails? At the moment I have: <div class="form_row"> <label for="theme">Theme:</label> <br><%= radio_button_tag 'theme', 'plain', true %> Plain ...

ASP.NET WebForms - Session Variables Null

I have an iframe keep alive (iframe that hits a page, defibrillator.aspx, on my site every few minutes to keep the session alive) on my masterpage for an asp.net app. This works most of the time but every so often my session variables return null during the page load on my defibrillator page. At first, I thought the session was being t...

Implementing a simple feedback form in JS

How do I implement the feedback form that the following sites have?: http://foodoro.com/ http://www.heyzap.com/ (look at the left center.) Thanks! ...

Inline Code on Webform Property

Why doesn't this display the date/time when rendered? <asp:Label runat="server" ID="test" Text="<%= DateTime.Now.ToString() %>" ></asp:Label> Is there anyway to make this work? ...

Best way to implement add/edit functionallity in HTML for several classes at once

I'm writing a web application in C#. I have several classes which are stored in a DB with Fluent NHibernate. The users would be able to list, add, edit and delete these objects. I would like to avoid adding controls on a class-by-class basis for editing and adding the properties like Name or Text, but rather have some method to add/edi...

ASP.net Webservice Date Parameter Timezone Offset Problem

I have an asp.net webservice with a parameter of type datetime. I have noticed asp.net seems to offset the date based on the clients timezone. I need to disable this functionality. I simply want to pass a date (i.e. 3/15/2009) to the webservice from javascript without any timezone context. Is my only option to change the parameter type...

Any slick and clever ways to inject JQuery before the page begins rendering?

I'm looking to somehow get jQuery inserted into every page with the MINIMUM of code written... in other words I don't want to write <script language="javascript" src="PATH TO JQUERY"></script> on every single aspx page. So far I've thought of using a Base class and inserting a "Response.Write" into the "page load" event. Besides that, w...

ASP.NET MVC - Missing "Convert to Web Application" option

I created a new MVC project and added some webforms pages to it in an effort to start adding new pages to my app using MVC and eventually port the old pages over as well. Everything is building and working correctly but I did notice that I don't have the "Convert to Web Application" option when right clicking an aspx file. And I think i...

How would this be done in ASP.NET MVC?

I've got some experience with ASP.NET MVC, but only with a web application where the content of the master page doesn't change. I've been wondering how you would handle a site where for example the menu (which is on the master page) is loaded from a database. Where would you load this data? In WebForms, you would load the menu in the c...

Wait for user input

i have a process that makes calls to a webservice and handles the responses, some of the responses require some user input so they can be handled. When user input is required i want to trigger an event, in the event handler i want to display a form to the page then wait until the user input is posted back then have the event handler retu...

ASP.NET Button vs Linkbutton Enabled="false" behavior

Why do ASP.NET LinkButton controls with OnClientClick attribute and disabled by setting Enabled="false" still render onclick event handler in HTML while Button controls don't? It seems counter-intuitive. Since anchors can't really be disabled in browsers, it makes more sense not to attach an onclick event (and href attribute) if it has ...