Wishing to reference an asp.net control (vb.net or c#) in JavaScript or jQuery how can I do this given that the ID is dynamically created? I can’t just write var fruitName = document.getElementById(‘tbxName’); Or the jQuery equivalent of Var fruitName = jQuery(‘#tbxName’); Each asp.net control added to the page is assigned a unique reference ID […]
Category: C#
Add Browser Redirection to ASP.NET File
Perhaps a page was created with a spelling error, or a reorganisation of the website means that a particular page has been renamed. We wish to redirect our visitors to the page to a different address. In the example below its assumed that the website page has moved to www.example.com/fruit-and-veg/. We wish to tell the […]
LinkButton Handles OnClick Equivelent in C#
To handle a Linkbutton onclick in VB.NET the LinkButton is declared and a handler sub declared: <asp:linkbutton id=”cmdAdd” runat=”server” ResourceKey=”Add” BorderStyle=”none” CausesValidation=”true” /> Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click ::: ::: End Sub C# doesn’t support the VB.net handles on click, the function is simply declared. The LinkButton declaration […]
C# Equivalent of InStr
In VB there is a test using InStr as to whether a string contains another string. C# uses a different function for the equivalent test. An example of the VB InStr function is given below If InStr(DishName,”apple”) > 0 Then Return True End If Return False } In the above example the name of the dish […]
Multiview Set Active View
The MultiView control is used together with a number of View controls to change the content presented to the website visitor. Setting the active view shows only that block of code as visible on the web page. An example of its use is a page showing a table of items. Selecting an individual table row […]
Converting Text to Proper Case
For a title or persons name VB.NET and C# can convert the text to initial capital letters. For example, to convert the lower case name john smith to John Smith. VB.NET To implement the conversion of the name to initial word capital letters, ie Proper Case, is a simple function in VB.NET StrConv(UserName, VbStrConv.ProperCase) C# […]


