I expected to type \n into the ConfirmText property of the AJAX Control Toolkit’s ConfirmButtonExtender and get a new line. This doesn’t work, but you can use this character code: Specifically, ampersand pound ten semicolon.
Controls inside an ASP.NET UpdatePanel cannot be bound to jQuery events after a partial postback. Here are some tips using pageLoad(): http://forums.asp.net/p/1189519/2039138.aspx http://encosia.com/simplify-aspnet-ajax-client-side-page-initialization/
I was looking for a way to filter child entities with eager loading. I ran into this useful blog post by Beth Massi on the subject. Here is the code I ended up using. It doesn’t work with server-side paging, but I didn’t need it in this case. Dim query = (From x In db.OrderChecklistItems […]
I found it tricky to get actual entities in the GridView RowDataBound event. Per Diego Vega’s post here, this may only happen because I am using the EntitySetName property of the EntityDataSource. Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim descriptor As ComponentModel.ICustomTypeDescriptor […]
I ran across this post on Stack Overflow. Here is the code I ended up using: Dim count = (From x In db.Orders Where x.OrderID = orderID From y In x.OrderDetails Select y).Count
To save a password hash to an XML file, you can call this function: FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text & "|" & txtUsername.Text, "SHA1") You can see my attempt at a password salt by simply apppending the Username.
Sometimes I want to show the e.Row.RowIndex of a GridViewRow in the markup of the page. I don’t want to hook into the RowDataBound method just to display a simple number. The answer varies for GridViews and Repeaters. Click here for the complete rundown. GridView: <asp:Literal runat="server" Text='<%# Container.DataItemIndex + 1 %>' /> Repeater: <asp:Literal […]
Data Access Practices Using Microsoft .Net: A Nerdly Comparison In this article a comparison of these options: – Connected Data Access with ADO.NET– Disconnected Data Access with ADO.NET and Typed DataSets– Basic Object Relation Mapping with LINQ to SQL– Object Relational Mapping with LINQ to Entities and the Entity Framework See also: Extending NerdDinner: Exploring […]
I was having some troubles with large ViewStates, so I found this article. It does an excellent job of explaining the inner workings of ViewState, and some of the common ways to misuse it. http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx – Zachary