Our mission Here is what we want to archieve with a standard ASP.NET gridview; We want scroll bars to scroll vertical in a potential long list When a row is selected in the gridview, we want to maintain the scroll position in gridview. (de default behaviour would be for the grid to jump back up […]
Category: ASP.NET Webforms
Securing session cookies in asp.net
Securing session cookies by itsself is very straightforward. By adding the following markup to the system.web section in web.config your session cookies will no longer function without https. <httpCookies requireSSL=”true” /> However, this will give you a new problem if you run in a test environment or debug session without https. Since the cookie will […]
Raising an event on a usercontrol, and subscribing to it from an ASPX page
This is a minimalistic demonstration on hooking into an event risen by a usercontrol. The main page subscribes to the event on the user control, and once the usercontrol raises a postback the event data is retrieved. User control code using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace UsercontrolEvents { […]
Passing data to an SqlDataSource on a user control from code
This code snippet demonstrates how to programmaticaly set a parameter on a user control, and bind that paramter to an SqlDataSource that has been configured at design time. The key to this functioning is a method in the usercontrol that sets a private field on the user control, and triggerin the DataBind() event on the […]
ASPxImageSlider – Resize slider for different devices
This code sample shows how to resize the ASPxImageSlider control for different devices and screen resizing. (thing rotating your tablet). The slider exposes a client side ID (ClientInstanceName = “imageSlider”) which can be hooked into with a little javascript. While this solves the basic problem, of having the slider react to different screen sizes, you […]
Scaffolding for an ASPxGridView with Select button using custom callbacks
Emulates the behaviour of the standard webforms grid, with a view where each line has a button that can be used to ‘select’ that line. This should make transition from the built in gridview to de ASPxGridView very easy. The click is processed server side It is not possible to select more then one line […]
Page and control level validation using javascript with asp.net
This sample is a complete minimal implementation of client side verification of inputs before a pass to the server is made. Verification is done on control level with the onblur() event, and on page level when the form is submitted. This validation is faster then round-tripping to the server for each event, especialy with large […]
Accordeon control
The accordeon control is part of the Ajax control toolkit and offers a series of tab-like sections, of which one is expanded at a time. Below is a minimal use sample of how to deploy the control. The ajax control toolkit can easily be installed from the NUGET menu within visual studio. Markup <%@ Page […]
Testing the Ajax Control Toolkit Tab control with WatiN
The Ajax Control Toolkit offers a large amount op ASP.NET Ajax control, and can be found on codeplex. WatiN is a popular test framework for UI testing ASP.NET web applications. Both can be obtained from the linked site, or can easily be added in Visual Studio with nuget. The objective of this writeup is to […]
Dropdown menu’s with ASP.NET and JQuery
This sample shows how to setup a basic JQuery popdown menu embedded in an asp.net webforms application, and how to position it correctly under your menu bar. As you will discover, no code behind at all is needed to make the basic functionality work, so no need for postbacks and displaying and hiding panels. The […]