webforms

"DropDownList.SelectedIndex = -1" problem

Hello, I just want an ASP.NET DropDownList with no selected item. Setting SelectedIndex to -1 is of no avail, so far. I am using Framework 3.5 with AJAX, i.e. this DropDownList is within an UpdatePanel. Here is what I am doing: protected void Page_Load (object sender, EventArgs e) { this.myDropDownList.SelectedIndex = -1; ...

ASP.net ACTK DragPanel Extender on PopupControlExtender with UpdatePanel does not drag after partial postback

I have a panel on an aspx page which contains an UpdatePanel. This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender. Upon initial show everything works fine, the panel pops up and closes as expected and can be dragged around as well. There is a linkbutton within the UpdatePanel which triggers a partia...

Linkbutton click event not running handler.

I'm creating a custom drop down list with AJAX dropdownextender. Inside my drop panel I have linkbuttons for my options. <asp:Label ID="ddl_Remit" runat="server" Text="Select remit address." Style="display: block; width: 300px; padding:2px; padding-right: 50px; font-family: Tahoma; font-size: 11px;" /> <asp:Panel ID="DropPanel" run...

In ASP.net Webforms how do you detect which Textbox someone pressed enter?

In ASP.net Webforms how do you detect which Textbox someone pressed enter? Please no Javascript answers. I need to handle it all in the code behind using VB.NET. ...

Multiple forms on ASP.NET page

Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page. However, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak the values of) a special form that posts to the PayPal website. If t...

How to display only one validation error message with a <tr:panelLabelAndMessage> with MyFaces Trinidad?

Hi, For a registration form I have something simple like: <tr:panelLabelAndMessage label="Zip/City" showRequired="true"> <tr:inputText id="zip" value="#{data['registration'].zipCode}" contentStyle="width:36px" simple="true" required="true" /> <tr:inputText id="city" value="#{data['registrat...

How to define listview templates in code

I am writing a Composite control, which contains a listview to display a table of items. Normally when using a ListView in Asp.NET I would define the templates in the code-forward. <asp:ListView runat="server" ID="ArticleList"> <LayoutTemplate> <div class="ContentContainer"> <div runat="server" id="itemPlaceholde...

Get Accordian Selected Index in ASP.Net C#

Im working on an ASP.Net app with c#. I am stuck on a problem with an accoridian. My accordian correctly displays data from a datasource which in this case in some text and then a list of images. On each accordians content there are the images to be displayed and then a button to add another image. This button links to another page t...

How do I chain my own JavaScript into the client side without losing PostBack functionality

So I was reading these Asp.Net interview questions at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about. ...

Moving to ASP.NET - VB or C#?

We have a large ASP classic code base but I'm looking to do future development in ASP.NET (and potentially in the future port across what we have). The natural choice of language seems to be VB (existing code is VBScript) but am I being too hasty? Does the choice of language, in the long run, even make a difference? ...

Disappearing checkbox label in ASP.Net 3.5 DetailsView control

I have a web form with a button and a DetailsView control on it. In the button's click event I change the DetailsView control to insert mode so I can add records: DetailsView1.ChangeMode(DetailsViewMode.Insert) Everything works fine, except for a checkbox in the DetailsView. When the DetailsView goes into insert mode, the text describi...

Disable button on form submission

I have a button that I would like to disable when the form submits to prevent the user submitting multiple times. I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled. How do I disable the button when the form successfully submits not just when the...

What are the key strengths of ASP.NET Webforms?

What are the key strengths of ASP.NET Webforms (2.0-3.5)? I'm not looking for comparisons to other frameworks, I'm just am looking for feedback on ASP.NET as it stands today. ...

Tips for avoiding big ball of mud with ASP.NET WebForms

Although ASP.NET MVC seems to have all the hype these days, WebForms are still quite pervasive. How do you keep your project sane? Let's collect some tips here. ...

What is the best way to unit test webforms apps ( ASP.NET )

What is the best way to Unit test my webforms applications? Looks like people are loving Watin, and selenium. ...

How to use javascript with an asp.net dropdownlist control?

I don't currently use ajax.net though I would be open to it if it is the only solution. I have a auto-complete control on screen that I am using to populate a asp.net dropdownlist with values through javascript (jQuery). I have had to use EnableEventValidation="false" to allow this. After I add my options to the select and the form is po...

Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators?

Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For instance use a asp:RequiredFieldValidator leave the server side code alone but implement your own client notification using jQuery to highlight the field or background color for example. ...

what's the best implemention of client creatable and modifiable web forms in a relational database?

In several web application projects I've been a part of, the client asks to be able to create their own forms. The question arises on how to store their form definitions, and then how to store user inputted values into those custom forms. I've seen it done two ways: Assuming that the client only defines how many fields, and what label...

Conditionally set an attribute on an element with JSP Documents (JSPX)

In HTML forms, buttons can be disabled by defining the "disabled" attribute on them, with any value: <button name="btn1" disabled="disabled">Hello</button> If a button is to be enabled, the attribute should not exist as there is no defined value that the disabled attribute can be set to that would leave the button enabled. This is ca...

why are local styles being ignored when using forms authentication in asp.net?

I have some styles applied to html for example <body style="background: #C3DAF9;"> and when I use forms authentication it is ignored. If I put the style into an external .css file then it works. This doesn't seem like normal behaviour to me. ...