[ASP. NET VB .NET] clientID and ClientID

Discussion in 'ASP .Net' started by Maras, Oct 15, 2003.

  1. Maras

    Maras Guest

    Hello,

    as we know VB is not case sensivity. I have a following problem,
    I have to send to another server few parametrs by post or get method,
    one of them MUST be a "clientID", it's preety simple, but in VB .NET
    there is a property ClientID and I get an error, a conflict beetwen
    my clientID and ClientID of MyBase class

    aspx code:
    ****
    [...]
    <form action="page2.aspx" runat="server" method="post">
    <input type="text" id="clientID">
    <input type="submit" value="Submit">
    </form>
    [...]
    ****

    aspx.vb code
    ****
    [...]
    Protected clientID As System.Web.UI.HtmlControls.HtmlInputText

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    clientID.Value = "i have to do something with this value here"
    End Sub
    [...]
    ****

    Haw can I solve this problem? In c# this works (case sensivity).
    Thanks
    Cheers

    --
    Maras
    Maras, Oct 15, 2003
    #1
    1. Advertising

  2. It is not a wise idea, from a CLI standpoint, to have two variables named
    the same thing but altered by case only. There is no real way around it, as
    this is an aspect of the VB.NET language to keep it "more compatible" with
    VB 6.

    For base classes, you can "hide" (Shadow) the base implementation and then
    call it through a fully qualified call. For example:

    Public Class MyBaseClass
    Public ClientID As String
    End Class

    Public Class MyDerivedClass
    Inherits MyBaseClass
    Protected clientID As System.Web.UI.HtmlControls.HtmlInputText

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    MyBase.clientID.Value = "i have to do something with this value here"
    End Sub

    End Class

    This allows you to access the base implementation, but may not solve your
    problem completely. Consider a re-architecture if you are naming values the
    same thing in different layers, as you will run into problems.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    **********************************************************************
    Think Outside the Box!
    **********************************************************************
    "Maras" <> wrote in message
    news:bmiuqm$9dm$...
    > Hello,
    >
    > as we know VB is not case sensivity. I have a following problem,
    > I have to send to another server few parametrs by post or get method,
    > one of them MUST be a "clientID", it's preety simple, but in VB .NET
    > there is a property ClientID and I get an error, a conflict beetwen
    > my clientID and ClientID of MyBase class
    >
    > aspx code:
    > ****
    > [...]
    > <form action="page2.aspx" runat="server" method="post">
    > <input type="text" id="clientID">
    > <input type="submit" value="Submit">
    > </form>
    > [...]
    > ****
    >
    > aspx.vb code
    > ****
    > [...]
    > Protected clientID As System.Web.UI.HtmlControls.HtmlInputText
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles MyBase.Load
    > clientID.Value = "i have to do something with this value here"
    > End Sub
    > [...]
    > ****
    >
    > Haw can I solve this problem? In c# this works (case sensivity).
    > Thanks
    > Cheers
    >
    > --
    > Maras
    Cowboy \(Gregory A. Beamer\), Oct 15, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henri
    Replies:
    2
    Views:
    12,067
    Henri
    May 18, 2004
  2. Miguel Dias Moura

    ClientID problem in Asp.Net 2.0

    Miguel Dias Moura, Mar 16, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    33,392
    Paul Henderson
    Mar 16, 2006
  3. Replies:
    0
    Views:
    469
  4. Ily
    Replies:
    1
    Views:
    465
    Axel Dahmen
    Oct 27, 2006
  5. Deere
    Replies:
    2
    Views:
    106
    Deere
    Oct 28, 2008
Loading...

Share This Page