webforms

How to capture the sender object in webforms on post-back?

If I do a form post w/ a non asp.net control in webforms, how can I get the id of the control that triggered the event from the sender object? Currently I'm adding a simple form post to my drop down list w/ jQuery and want a method to capture the specific control on the server side ... $(document).ready(function() { $("*[id$='ddlEm...

Clean way to offer a 'review' stage in an ASP.NET form

I'm currently working on a reasonably complicated data input form, based around ASP.NET Web Forms. After the form has been completed, we'd like to offer a chance for the user to review their input before actually submitting the form (as well as going back to make changes to their data if requried). Due to the large number of fields, I w...

Using an ASP.NET repeater with an array?

This may be a silly question but I was writing a quick test page and realised that I didn't know how to bind an array or ArrayList of strings, for example, to an ASP.NET Repeater. I experimented a bit. <asp:Repeater ID="rptImages" runat="server"> <HeaderTemplate> <h3>Items</h3> </HeaderTemplate> ...

What is the best approach to kicking off an SSIS package from asp.net?

I need to fire off an SSIS package when a specific action occurs - what is the best approach in webforms. ...

How to get first selected item in an asp:ListBox with SelectionMode="Multiple" to appear at top?

In asp.net if you define an asp:ListBox as follows: <asp:ListBox ID="listBox2" runat="server" SelectionMode="Single" Rows="3"> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListIt...

ui for asp.net web forms application

Is there a professional service or product anyone recommends for improving the ui of an existing asp.net web forms application? All web controls/elements use css classes and there is a single css file where the look and feel and be controlled. I'd like to have a professional designer improve the color scheme/font/layout, without having...

Designer page not being refreshed when controls are dropped on the form

(Was: ASP.Net codebehind not finding controls on the web page) I'm using VS 2008. I don't know what secret switch I need to flip, or what trip wire I accidentally tripped over, but the last form I created in my project is misbehaving very seriously: the codebehind is apparently unable to find any of the controls that I have set up on t...

asp.net webforms and jquery: How to save/restore jquery state between postbacks?

I am building a asp.net webforms (3.5 sp1) application, using jquery where I can to animate the UI, change its state. It has worked great until I started doing postbacks, where the UI obviously resets itself to its initial state. So my question is, what are the best practices for saving and restoring jquery/UI state between postbacks? ...

How to get the value of a control from the child into the properties of the parent in .NET?

I have a form that has a few similar controls and the parent contains the properties, but the child actually has the html controls. How could I setup my getters/setters using the "child" controls in the parent class? (Webforms - fyi) I found the below via search, and what I'm looking for is the inverse http://stackoverflow.com/questio...

Asp.net 1.1 to 3.5 migration problems

Hi, We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine. We made some code changes to the .cs file. Sa...

Using data to set properties of a GridView

Hi, I need to set the 'ReadOnly' property of a BoundField in a GridView to the value of a bit field in the recordset that is being displayed by the same GridView. I am aware I could achieve this in code, but I was wondering, out of interest, if it's possible to do this declaratively inside the property using a <% %> snippet? Cheers, ...

How to get the HTML output from a DataGrid?

Hi, I was wondering if there was a way to some how get the HTML output of a DataGrid. I want the raw HTML after the data has been bound to the grid. Is there some sort of overload for the render method I can use to accomplish this? Thanks. ...

Writing from one form to another

I have two forms. Form A has three text input; A1, A2, A3. Form B has one text input, B1. Whenever you type in any of the inputs on Form A, Form B should get updated, right away, with all three inputs from Form A. If one of the Form A inputs is empty, a 0 should replace it in B1. For example, if I'm typing "test" in A1 and leave A...

Localise ASP.NET 2.0 App

At the moment, all of our localised texts are stored in resource files and then referenced using <% $Resouces:Something %>. Unfortunatly this method is not scaling too well, were getting lots of diff problems & the files are becoming rather big. Does anyone know of a better solution for localisation? Or is resource file's all I've got in...

How to get rid of the "default" form-element from a .aspx-page?

As that web-standards geek I am, I dislike the default <form runat="server"> that surrounds my entire webpages. I've seen many ASP.NET based webpages that don't have these, so it seems like it can be removed without taking away any functionality. How? ...

How to migrate existing asp.net application to asp.net MVC pattern format

I want to migrate existing asp.net application to asp.net MVC pattern format now. What procedure should I will follow? Any step-by-step instructions would be very helpful. ...

In a asp.net webforms UserControl, why do controls need to be protected

On a UserControl in asp.net webforms, Why do the controls within the usercontrol (TextBox, DropDownList, etc.) have to be declared as protected in the code-behind. Is there runtime inheritance occuring with webforms? ...

Converting from Web Forms to MVC

Has anybody gone through the process of converting a real-world business application from ASP.NET web forms to MVC? How painful was the transition? Would you say that it was worth it, overall? I am trying to figure out if it is worthwhile to take the time to convert an application over to MVC for increased performance. ...

ASP.Net Web Forms Entity Level Access Control

I have an ASP.Net Web Forms application in which I'm using forms-based authentication with Membership and Role providers, which is fine for authenticating and controlling access to directories and/or files. Now I find myself needing to control read, write and delete access on individual entity instances, for example being able to update ...

Preventing webform resubmission on browser refresh without losing viewstate

Duplicate: http://stackoverflow.com/questions/305684/how-can-i-prevent-database-being-written-to-again-when-the-browser-does-a-reload Is there a nice elegant way to stop an .aspx page from resubmitting form data if the user requests a refresh from their browser? Ideally without losing the viewstate. EDIT: The most elegant solution f...