webforms

Checkbox not entering OnCheckChanged first time

<ajaxtoolkit:AccordionPane ID="accordianPaneAroundTheCheckbox" runat="server"> <Content> <asp:UpdatePanel ID="updatePanelAroundTheCheckbox" runat="server" > <ContentTemplate> <div> <asp:CheckBox ID="chkFoo" AutoPostBack="true" runat="server" OnCheckedChanged="DoBar"/> ...

C# Generic List and ASP Repeater Fun

Hi I'm trying to render out some images on an aspx page. Error I'm getting in the code below is: DataBinding: '_Default+ImageThing' does not contain a property with the name 'FileName'. public class ImageThing { public string FileName; } private void DisplayThumbnailImages() { ImageThing imageTh...

Wait 3 seconds before form submits | JavaScript

I have this piece of code here: function checkAmount() { var PayField = document.getElementById('paymentamount'); var Pound = document.getElementById('pound'); if (PayField.value == "") { PayField.style.border = '1px #F00 solid'; Pound.style.color = '#F00'; alert('You need to enter an amount that...

Flask / Python. Get mimetype from uploaded file.

Hi, I am using Flask micro-framework 0.6 and Python 2.6 I need to get the mimetype from an uploaded file so I can store it. Here is the relevent Python/Flask code: @app.route('/upload_file', methods=['GET', 'POST']) def upload_file(): if request.method == 'POST': file = request.files['file'] mimetype = #FIXME ...

ListView controls display wrong data the 3rd time

I have a ListView that populates and displays a user's data (via a profile system in VWD 2008) during Page_Load and also when I go from the EditItemTemplate to the ItemTemplate. When I go to the edit screen again, my DropDownList and RadioButtonList controls display the first items in the corresponding tables instead of the correct pro...

MVC in C# coexisting with Webforms in VB. Can it happen?

I have inherited a really awful webforms application that is all kinds of bad--an untestable hairy mess of datasets and Page_Load events. Object oriented? N-tier? Unit tests? source control? All academic niceties to the team that built this mess. It started life as an asp classic app, got mostly ported to VB.NET. Management denied m...

Are ASP.Net Control IDs bad for SEO and page size?

ASP.Net controls (e.g. asp:Label) generate messy html ids (e.g. ct100_ct100_Yabba_Dabba_Doo_FinallyTheRealId). Yeah, they're ugly, but someone told me today that they're also: unfriendly for SEO increase the page size I half believe 1) and half disbelieve. I know that certain id names (e.g. "header") are keywords that search engines ...

Checkbox Array Values in $_REQUEST but not $_POST

For some reason my checkbox array values don't show up in $_POST. For example: <form method="post" action=""> <input type="checkbox" name="cb[]" value="1"> <input type="checkbox" name="cb[]" checked="checked" value="2"> <input type="checkbox" name="cb[]" value="3"> <input type="checkbox" name="cb[]" checked="checked" va...

Multiple forms with one page in tipfy

I haven't been able to find an example of using multiple forms on one page (or one Handler) for tipfy. I'm trying to allow users to both answer (form 1) and comment on an item (form 2) from the same page. One approach to doing this in PHP is submitting a hidden form and checking for it before processing. However, I'm not sure what t...

asp.net routing on homepage

Hi all, When using routing (asp.net webforms) I want to setup a home route so I can browse articles on the frontpage like this domain.com domain.com/1 domain.com/2 domain.com/3 I have no idea how to setup this routing because ~/ isn't accepted in the route. I tried http://www.domain.com/home/1 which works fine but is less nice ofcours...

Design, storage and retrieval of dynamic forms

What is the design behind custom dynamically generated forms? Would like to implement something like drupal's CCK. In the control panel, the owner of the form designs what fields should be in the form and in what order the form fields should be in, as well as the field's attributes such as "required: yes/no" Once the form has been de...

Suggestions for an ASP.Net webforms application architecture?

I created an empty Visual Studio solution and added two projects: Backend(Class Library type) that will have the.edmx file for accessing information; and Frontend(ASP.Net type) that will have the database in the app_data folder. Is this a good architectural design or is there a more proven way to organize this type of application? ...

How to make pretty ASP.Net forms?

Is there a RAD-way to create nice looking forms with ASP.Net webforms? I'm using .NET Framework 3.5 and Visual Studio 2010. Thanks! Is there someway of having something like the DataGrid autoformat. ...

How to apply CSS to a textbox?

I have this code, and it renders this HTML. How can I apply CSS to my control if they are named ctrctrctr-00000 or something else like that that is only useful to the VIEWSTATE? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/199...

How to use label for in an ASP.Net webform?

I get this as pure HTML: <label for="txtPais">Pais:</label> <input name="ctl00$ContentPlaceHolder1$txtPais" type="text" id="ctl00_ContentPlaceHolder1_txtPais" class="textInput" /> In my actual code in Visual Studio I have this: <label for="txtPais">Pais:</label> <asp:TextBox ID="txtPais" runat="server" CssClass="textInput"></...

BulletedList onClick not firing

Ugh, this is driving me mad Im trying to build up a dynamic menu from a bulletedList, most menu items are plain links however the log out button needs to perform some cleanup code. I cant for the life of me get the BullettedLists onclick event to fire. The BulletedList is inside a user control (if that makes a difference) Any ideas? ...

ASP.NET 4.0 - Conversion failed when converting from a character string to uniqueidentifier!

I am trying to retrieve xml from a small function in my .cshtml page. Its throwing me an error. This however, runs fine in a console/form environment. It takes 3 parameters and 1 exception. myDll.GetXML(year, username, uniqueidentifier, out ex); When I run this page I get the error, “Conversion failed when converting from a character...

Display Pound currency sign (£) in a DataBound DropDownListItem

I need to show items like in below image. I'm using this code to bind dropdownlist. var options = (from option in _serviceOptions select new { OptionId = option.OptionId, OptionText = option.OptionText + " - " + option.Price + "&pound;/month" }).ToLi...

How to display a form list box as read-only or disabled with a selected index?

The user sees a form with many controls, including a list box. He selects a single item in the list box and presses "submit". In PHP I access $_POST[] and want to display the list box as read-only or disabled with his his selected item also selected. It should be read-only or disabled because I am showing him what he submitted and I don...

PageMethods not showing the my function which is declared server-side

I have a function which I defined in the code-behind as follows: <WebMethod()> _ Public Shared Function testFunction() As Integer Return 0 End Function I'm trying to call it using Javascript on the client-side as shown below: <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="True"...