webforms

Nested ASP.Net web forms + nyromodal : Postbacks die after modal is closed.

Hi All, I have an ASP.Net web page, which uses a Master Page template. The page has an UpdatePanel with some basic AJAX functionality (change the value of a DropDownList and the UpdatePanel will refresh). This is all working nicely. I also have a link that pops up a nyromodal Modal, inside the modal, another ASP.Net web form is loaded...

Determine at runtime which submit button to use

Hello I have a asp.net webpage, it has two search fields with separate submit buttons. I'd like to allow the user to enter some data into one of the fields and then press the enter key and it submit using the appropriate button. Right now, the enter key submits for the first submit button, but I want this to change if there is data in t...

MVP pattern using webforms and DI object instantiation

I am using the generic repository pattern to persist my data. On the PageLoad, I am creating a new Repository (from IRepository) object, and on PageUnload, I dispose of it. Should the MasterPage/Page be in charge of instantiating the objects to pass to the presenter or should the presenter be in charge of this? I'm more concerned wi...

Coding practice: how to avoid hard coding?

I have a table in the database that store 4 category and the structure of the table is ID (GUID), description. I load the category into a dropdown list (asp.net webform) to allow people to select a category and based on what they selected. I'll then display info associated with their selection and hide the others. Currently, i do a "se...

Assyncronous interaction using Sys WebForms PageRequestManager

Hi guys, I'm trying to display a panel to the user when an asynchronous call is made, but only if that happend from a specific call. using the normal "get control" script I have mine like: function pageLoad() { try { var manager = Sys.WebForms.PageRequestManager.getInstance(); manager.add_endRequest(OnEndRequest);...

Should I learn ASP.NET if I prefer to have fine-grained control over my site's HTML?

For months, I've been considering downloading Microsoft's express web platform and learning ASP.NET, which I might actually enjoy, seeing as I already do web work with PHP, but am much more comfortable with C#. However, the primary reason I don't want to do this is that I've always associated ASP.NET with useless spaghetti HTML. The li...

WebForms custom / dynamic routing

I'm using Phil Haack's URL routing for WebForms and I would like to define a route that's "dynamic." Let's say I have this route: "{any}.aspx" -- goes to --> "~/PageProcessor.aspx" This would take any request that's not a physical page to the PageProcessor page. This works great. The problem is that, based on some data that comes from ...

Is ASP.NET MVC destined to replace Webforms?

I found these questions, but a couple of them were a little old: http://stackoverflow.com/questions/191556/should-i-pursue-asp-net-webforms-or-asp-net-mvc http://stackoverflow.com/questions/88787/do-you-think-asp-net-mvc-will-compete-with-asp-net-webforms http://stackoverflow.com/questions/722637/asp-net-mvc-asp-net-webforms-why I do n...

jQuery form validation multiple forms

Duplicate Answered here: validate multiple forms If all asp.net controls are required to be within a form in order to be generated, how does one go about using the jquery validation plugin with multiple forms on the same page? What I mean by that is, how can I have two forms both containing asp controls that can be validated indepe...

Should I use <button> or <a>, submitting a styled web form

For my html form, it seems that I'm unable to create cross browser hover and pressed states for <button>. I really want this as it creates good user feedback (and a polished look and feel). With <a> it's easy to do, but it breaks accessibility rules. What should I do? As requested, an example: <form name="contact" action="index.php"...

Why does the runat-attribute in the head-tag change the way meta tags are handled in ASP.NET?

Example 1: <head> <meta http-equiv="description" content="<%= Foo %>"/> </head> Renders <meta http-equiv="description" content="Bar"/> Example 2: <head runat="server"> <meta http-equiv="description" content="<%= Foo %>"/> </head> Renders: <meta http-equiv="description" content="&lt;%= Foo %>"/> Note the discrepancy, the <...

Creating model objects from raw form data - is a one-to-one field match required?

If I say this in the controller: @order = Order.new(params[:order]) What is required for this to work? Does there need to be a one-to-one match between all of the fields in params[:order] and the Order model? Or can there be more or fewer fields in params[:order] than are required to instantiate an Order? ...

What are the benefits of using namespaces in webform pages?

I understand the pros of using namespaces within the actual application layers but when it comes to the front tier, I am not so sure. My project is a Website (not WebApplication) and I get all sorts of problems (missing references, for one) when I try and include "namespaced" user controls. Despite explicit declarations in web.config u...

Masking password from user in HTML Webforms.

I'm working on a weblog application in php and javascript. I use windows live ID for authentication. The user needs to provide a password for windows live writer because live writer can't use live id. I want to enable the user to edit his password in an html webform. although the password is typed into a password field showing only *, ...

How to structure HTML form elements so they can be easily translated into a PHP object?

I am trying to figure out the best way to name my HTML form fields so that they can be easily parsed into a set of PHP opbjects. For example I have the following table of elements: (let's assume it is inside a form) <table> <tr id='payment0'> <td><input type='text' name='paymentType0'></td> <td><input type='text' name='paymen...

Looking for a web based, client side form editor

I'm looking for a javascript library (could be based on jQuery) that will implement a client side Form Editor. The perfect example is something like offered by http://wufoo.com/ You should play with their free version to get the feeling of what I'm trying to find. Also see this example someone made with jQuery. it is very basic, but a ...

VbScript ASP: checking checkbox

I have a html page with a form that has some check boxes. I need, using VbScript ASP, to make sure that one checkbox is checked. How do I do that? Here's the checkbox itself: Dim terms terms = Request.Form("terms") ...

Encoding problems in JSP

I have an html-form with several text fields. When I try to submit not English characters (Russian in my case) server is received "unreadable" string (not questions - "???" but some strange characters). I simplified my code to show it here: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page contentType="text/...

Strong typed Container in WebForms

Hi Take following example of code: (ASP.NET WebForms) <asp:Content ContentPlaceHolderID="Contents" runat="server"> <div class="blogpost-list"> <asp:Repeater ID="blogList" runat="server"> <ItemTemplate> <h2 class="blogpost-title"> <%# (Container.DataItem as BlogPost).Title %> ...

How to stop Pages becomming too bloated in webforms

I have an ASP.net webforms app that connects to a web service, All the functionality is on one page that has lots of difference states and I use a multi view to display the correct html depending on the current state. The problem is the page is huge and unweildly. The code behind isn't so bad but the aspx page is just out of control. I...