webforms

Asp.net forms authentication login loop

How do you solve the infinite login loop problem when you are using cookieless sessions and cannot change the name of login.aspx to a httphandler ? i.e. When a user with admin rights hits the logout button and the return url to a restricted page is passed to login.aspx then another user without admin rights try's to login they get redir...

Get non-UTF-8-form fields as UTF-8 in PHP?

I have a form served in non-UTF-8 (it’s actually in Windows-1251). People, of course, post there any characters they like to. The browser helpfully converts the unpresentable-in-Windows-1251 characters to html entities so I can still recognise them. For example, if user types an →, I receive an →. That’s partially great, like, if I...

Setting RegularExpressionValidator ValidationExpression in JavaScript

Is it possible to set the ValidationExpression of a RegularExpressionValidator using JavaScript? I'm using ASP.NET 3.5. Here's why I want to do this... On a payment page I have a DropDownList that allows my user to select their card type. Beneath that is a TextBox in which they type their card number. I want to use a RegularExpression...

ASP.NET WebForms Data Binding Solutions

I am looking for some easy to use data binding to forms controls. Something that will handle formatting, validation and error handling, something that will handle filling controls from business object/DTOs and vice versa with minimal code. I did use google and have found these two links: Implementing two-way Data Binding for ASP.NET ...

Exception handling in ASP.NET Webforms

What is the preferred method for handling exceptions in ASP.NET Webforms? You have the Page_Error method that you add (I think) at web.config level, and the entire site gets redirected there when an error occurs. Does that mean you shouldn't use try-catch anywhere in a webforms application? (Assuming you don't want to hide any errors) ...

When is it appropriate to use AJAX?

When is it appropriate to use AJAX? what are the pros and cons of using AJAX? In response to my last question: some people seemed very adamant that I should only use AJAX if the situation was appropriate: Should I add AJAX logic to my PHP classes/scripts? In response to Chad Birch's answer: Yes, I'm referring to when developing a "stan...

ASP.NET Repeater Template, Conditional Code for every Nth element

I'm using an asp.net repeater to create a bunch of images. The image markup is all the same so the standard <ItemTemplate> is fine. However, I want to wrap K images in a div. Lets say I bind 25+ images to the repeater and I want 5 images per div. How do I go about conditionally creating the start and close tags for the div? Is this a...

asp:Calendar DateClicked event (not just SelectionChanged)

I am using the standard asp:Calendar control. When a user clicks a date, I am showing a modal popup by handling the SelectionChanged event. However this means that nothing happens if the user clicks a date, then closes the popup, then clicks the same date again. I'd rather be handling a DateClick event, and do away with the concept of ...

What is the right way to use the AttributeCollection.Render method?

I've created a web control and I want to pass the element attributes through during the render phase. I would prefer use writer.RenderBeginTag() and RenderEndTag() but this is the only way I can seem to integrate the attributes successfully: public override void RenderBeginTag(HtmlTextWriter writer) { writer.Write("<"); writer.W...

Prettifying ASP.NET Markup

So, my personal site is running on a custom blog engine that I wrote, and I'm really happy with it. However, it uses a master page, which means that ASP.NET prepends (for no good reason) 'ct100' to all of the id's...For example: <div id='menu'> <ul> <li id="ctl00_homeTab" class="active"><a href="/">Home</a></li> <li id="ctl00...

1. I fill out a form & click submit. 2. I get the results page. Goal: Get the same results without filling out the form again.

This is my first time posting - I greatly appreciate any and all guidance on this subject. Background: I am building a Real Estate web site. I would like to use the free IDX data provided by my local MLS board. The MLS board does not allow me the option of displaying a predefined search and only provides me with a link to the search fi...

asp.net 3.5 Am I "Getting" this?

Hi, I am learning ASP.NET 3.5 & C#, using Visual Studio 2008. Most of the stuff I learn is through the MSDN. I am trying to develop a web page that will allow a user to create a character for use in an RPG game. The user should be able to allocate attributes, buy items, etc. When the user is done the site will format a printable characte...

What's the "right" way to isolate control dependencies

I've made it a personal rule to inherit every UI control before using it. In a previous life I'd always considered this one of the less useful things you could do because the justification always seemed to be "I might want to change the font on all the buttons at once"... a motivation that never paid off... once... ever. Two recent pro...

What is the 'page lifecycle' of an ASP.NET WebForm?

I'm looking to get a more thorough understanding of the ASP.NET page lifecycle. I'm in the process of building custom form controls and have found my knowledge in this area to be lacking. Are there any resources, tutorials, etc. that you've used to better understand this area? Are there any tools you've used to improve your knowledge i...

GET or POST, which method to use for submitting a form?

I'm writing a web form for my Ruby on Rails app. The form has a text field, some checkboxes, a set of radio buttons and two text boxes. What are the pluses and minuses of using GET over POST and vice versa. I always thought you should use GET for retrieving the form and POST for submitting, but I've just learnt you can do both. Does it...

What would be the best framework for XML/XSL/XSD/XHTML app with PHP

I am in the process of designing a web application that takes HTML form input and validates against XSD files and eventually stores data in a Database. I am looking to use the LAMP stack for this application and am looking for ideas on what framework(s) to base my application on. The following are my requirements: Web Application with ...

How to fix ASP.NET error "The file 'nnn.aspx' has not been pre-compiled, and cannot be requested."?

I have a VS 2005 web site that I publish using "Publish Web Site", and I clear all the three checkboxes. I also have a deployment project that picks up the published files and creates an MSI. I then install the package on a separate test server. In other words, the whole site is pre-compiled. However, when I go to any .aspx file in a sp...

C# ASP.NET Post Back Data

Hi, I have a web page form which contains around 20 forms(home.aspx), on 1 of it i need to put a link beside a textbox which will be pop out when the user clicks the link(search.aspx). In this pop out link there will be a search textbox which will search the database based on the keyword that user enters. Let's say the user enters id num...

Jquery question: How can I break up a multi-part form so that only one fieldset is visible at a time?

Hi! I have a firm grasp on XHTML & CSS, but PHP & Javascript look like magic to me. I'm building a discussion site using the PHP-based Textpattern CMS. When users are logged in, they can use a public-side form to add a new discussion topic. There are a lot of input fields, grouped by the HTML fieldset element within a single form elemen...

IE is not submitting; dynamically added form elements; is this an IE bug?

I wrote some Javascript to allow editing a list of items within an HTML form, including adding and removing items. Got it working in Firefox. When trying it in Internet Explorer, I found that any added items were not being submitted with the form. Long story short... lots of simplification, debugging, figured out what line is triggering...