How to Convert C# Code to VB code in the ASPX demos files

3 posts, 1 answers
  1. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 13 Jan 2009 Link to this post


    I've noticed that in several of the demos, i.e.: the ASPX page is using a default.cs file.  Even though you provide the VB code, can you use it with a default.cs file?  I've noticed that Telerik staff also will list the .C# code, not usually the VB code.

    If not, could you tell me how to make the default.aspx page useful for VB?  Should I revise the highlighted yellow text of Line 6 in the ASPX page as follows:

    1 <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    2 <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %> 
    3 <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %> 
    4 <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %> 
    5 <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %> 
    6 <%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.ComboboxExamplesCS.MultipleComboBoxes.DefaultCS" Language="c#" %> 

    Line 6: (revision in bold text)

    <% Page AutoEventWireup="true" CodeFile="DefaultVB.aspx.VB" 
    Inherits="Telerik.ComboboxExamplesVB.MultipleComboBoxes.DefaultVB" Language="vb" %>

    Is this correct?  I would Add a New Web Form (not use the VB default page), name it and copy & paste the .aspx code it into the new VB web form.  That way the code behind file would be created correctly without my trying to revise that.  (I've run into problems in the past trying to change the "CodeFile" and "Inherits" keywords or rename the default page).

  2. Answer
    Dimo avatar
    8407 posts

    Posted 14 Jan 2009 Link to this post

    Hello R2,

    Actually all of our online demos have a DefaultVB.aspx file, so you don't have to make changes to the DefaultCS.aspx. For example:

    There is a language switch above every example (on the right side), that allows you to switch the ASPX language from C# to VB and vice-versa.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. R2
    R2 avatar
    63 posts
    Member since:
    Sep 2007

    Posted 14 Jan 2009 Link to this post

    Cool!  Thanks Dimo!
Back to Top