James Flower

C# .NET and Web Developer

Tag: asp.net webforms

There are 2 posts with the "asp.net webforms" tag.

Strongly Typed Data in ASP .NET Web Forms

Posted on
3 min read

In ASP .NET Web Forms you’ve previously had to use strings to specify which properties you’d like to output when databinding, which would probably end up looking something like the following. <asp:templatefield headertext="Last Name"> <itemtemplate> <asp:literal runat="server" text="<%#: Eval("LastName") %>"> </asp:literal></itemtemplate> </asp:templatefield> In all likelihood it could probably look far less tidy if you’ve ever needed to do any formatting on values y

Read more...

Using a RequiredFieldValidator on a DropDownList in ASP .NET

Posted on
2 min read

In most applications today drop-down lists default to a “Please select..” option with some form of validation to ensure the user makes their own selection. In ASP .NET web forms this frequently results in a drop-down list being created using code similar to that displayed below. <asp:DropDownList ID="ddlOptions" AppendDataBoundItems="true" runat="server"> <asp:ListItem Text="Please select an option..." Value="-1" /> </asp:DropDownList> We can add an ASP .NET RequiredFie

Read more...