asp.net-webforms

Pre written Exception Handler for ASP.Net

I'm looking for a Exception Handler for asp.net that does email notification including things like the values of form fields, session variables etc. I have one that does it currently written by someone in house but it's not maintained and occasionally there are bugs in it causing give me only partial exception messages. I tried googlin...

How to register types that implement a specific interface on a ninject container

How can I register on a ninject container all the types that implement a specific interface? It's worth saying that I'm using Webforms so IBuildManager is not available. I'd like to achieve something I saw on a MVC application with unity which goes like this: private static void RegisterRepositories(IBuildManager buildManager, IUnityCon...

How to prevent CSRF attack in asp.net webform?

How to prevent CSRF(Cross-site Request Forgery) attack in asp.net webform? Is there anything of webform like [ValidateAntiForgeryToken] of asp.net mvc? ...

how to use repeater control for getting a data from a database in C#

<%@ Page Language="C#" MasterPageFile="~/AdminMaster.master" AutoEventWireup="true" CodeFile="CompetitionApplication.aspx.cs" Inherits="admin_CompetitionApplication" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <table> <tr> <td style="width: 185px; heig...

how to pass command argument while calling link button onclick function dynamically? (c#)

Hi there! I have a function for which i am sharing a group of link buttons with. the function signature is like: protected void FunctionName(object sender, EventArgs e) { ... } Now I have about 4-5 link buttons which i am using to call the same function but just filtering the stuff via command argument like: <asp:LinkButton ID="l...

Best Practices for Passing Data Between Pages

The Problem In the stack that we re-use between projects, we are putting a little bit too much data in the session for passing data between pages. This was good in theory because it prevents tampering, replay attacks, and so on, but it creates as many problems as it solves. Session loss itself is an issue, although it's mostly handled ...

SEO and migrating to ASP.Net MVC

It's well-past time for The Office's websites to be upgraded and for the main public one, I'm considering migrating the existing .Net 1.1 ugliness up to ASP.Net MVC. The only real doubt I have is over the fairly extensive work on SEO that has been carried out on the site. What considerations should I bear in mind regarding SEO when mov...

Post data to different ASP.NET WebForm

In my ASP.NET WebForms application, I have a WebForm that contains an UpdatePanel and multiple views used for a wizard like interface. At the end of the wizard, the user has an option of moving to another page by clicking a button. This new web page needs about 5 values from controls in the previous page. What is the simplest way to d...

ASP.NET Form value validation scenario

I have the following html in my ASP.NET form. It represents a dropdown menu to let the user choose his budget. When the user selects a value on the list. A jquery code copies the selected value in the ProjectBudget hidden field so it can be submited through the form. <p><label>Project budget*</label></p> <a href="#" class="SelectionDrop...

asp.net routing (in webforms) without wildcard mapping

If you cannot turn on wildcard mapping for IIS (shared hosting) or can't be bothered (lazyness) can you still use ASP.Net routing if your routes end in one of the "known" asp.net extensions...like ending all routes with .ashx, .aspx etc? From Chris Cavenagh's blog, could his examples of: var routeHandler = new WebFormRouteHandler<Page>...

can anyone define a stack for a ASP.NET Web forms application?

what is the stack for a asp.net Web forms application?and why? example for ASP.NET MVC there is an example: http://codeclimber.net.nz/archive/2009/10/15/my-asp.net-mvc-stack-and-why-i-chosen-it.aspx thanks ...

ASP.Net dropdownlist within a detailsview not being set in codebehind

I have the following code in my codebehind Page_Load function that sets the default selected value of a dropdownlist in detailsview based on the name of a record returned from a sql data query. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.Page.Title = "Editing record" '...

Set dropdownlist selected value on initial page load

I posted a similar question previously, but none of the answers worked and I've been scouring all over the web trying to find a solution. My situation, I have a Edit Window webform with a dropdownlist (Note: to avoid confusion, I'm using Telerik extensions only to decorate the webform): <%@ Page Language="VB" CodeFile="EditFormVB.aspx....

Why can I not pass this interface as an argument?

I don't have much experience with generics, but can someone please explain to me why this doesn't work and what I need to do to get it to work? I have 3 interfaces. public interface IOnlineView public interface ICalendarView : IOnlineView public interface IDateView : ICalendarView Then I have 3 presenter classes public abstract cl...

Primary keys on webforms (load initially or on save) ?

This is just a general question irrespective of database architecture. I am maintaining an ASP.NET web application. The structure is such that, Say on 'Add a new employee' webform The primary key (or the record id to be saved with) is initially loaded on form load event & displayed as a label So when the form loads, the record id to ...

Asp.net WebForms app that runs MVC in a subfolder

Let's say I have an Asp.net WebForms application that has: few *.aspx files in root folder that run as WebForms application (no routing involved) a subfolder ie FormsFolder that has other files and subfolders in it that run as a regular web forms application a subfolder MvcFolder that has a normal structure of an Asp.net MVC applicatio...

ASP.Net MVC vs Web Forms what are the benefits of one over the other

Possible Duplicate: MVC versus WebForms Was curious what the main benefits of going MVC over Web Forms. I write everything in web forms currently but I already enforce a pretty strict separation on myself would I see any benefits from moving to MVC? Currently I use jquery for my AJAX; calling Page Methods and Web Services....

Formatting text in an ASP.Net Boundfield

I have a webform with a a couple of boundfields in an edit window as follows: <asp:BoundField DataField="TS_TITLE" HeaderText="Title" SortExpression="TS_TITLE" HeaderStyle-VerticalAlign="Top" HtmlEncode="True" > <ControlStyle Width="500px" /> </asp:BoundField> <custom:BoundTextBoxField DataField="TS_DESCRIP...

Filling a DropDownList with an AJAX response and getting the selected value on the server with ASP.NET WebForms

I'm having trouble with this simple scenario. First, I'm using ASP.NET WebForms. I'm making an ajax call using jQuery after the user select a value on a first dropdown (select). This call will return me an array of values with which I fill a second DropDownList. After a postback, of course the DropDownList has no items. I have tried ...

Why doesn't this code work in the source view

I have this piece of code: Reps.Algo _Rep = new Reps.Algo(); Model.Entities.G guia = new Model.Entities.G; guia = _Rep.GetById(GuiaId); foreach(var un in guia.Unidades) { Do Something } When...