Re: Variables in the HTML part of a web form...

Tech-Archive recommends: Fix windows errors by optimizing your registry



I understand and use DataBinder.Eval quite frequently. If you point it to a
constant that contains a string value, that string value is what it should
return.


"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OsvYz4z$FHA.4012@xxxxxxxxxxxxxxxxxxxxxxx
> Granted, I haven't tried.
>
> But Eval() is a method like any other. The 2nd parameter is the name of
> the property/column it'll look up through reflection. If you pass "Hello"
> or a variable with the value of "Hello", I'd expect to get the same
> result.
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "Scott M." <s-mar@xxxxxxxxxxxxx> wrote in message
> news:%23uSmLxz$FHA.3992@xxxxxxxxxxxxxxxxxxxxxxx
>> I'm not sure this approach will work. At runtime, wouldn't this look to
>> bind to EName, which has a value of "T003_EntityName_String",
>> and therefore that is the data you'd get back, not the data that
>> "T003_EntityName_String" refers to?
>>
>>
>> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
>> wrote in message news:OdsjWcz$FHA.4036@xxxxxxxxxxxxxxxxxxxxxxx
>>> Well, assuming EName is defined something like:
>>>
>>> public class DatabaseColumn
>>> public const EName as string = "T003_EntityName_String"
>>> end class
>>>
>>> you should be able to simply do:
>>>
>>> <%# DataBiner.Eval(Container.DataItem, DatabaseColumn.EName) %>
>>>
>>> IF DatabaseColumn is in a separate namespace than the page, you'll need
>>> to either fully reference the namespace OR @Import the namespace.
>>>
>>> Karl
>>>
>>> --
>>> MY ASP.Net tutorials
>>> http://www.openmymind.net/
>>>
>>>
>>> <rlrcstr@xxxxxxxxxxxxxxxxx> wrote in message
>>> news:Ok4aZFz$FHA.3568@xxxxxxxxxxxxxxxxxxxxxxx
>>>> The DBA team at the office controls the naming conventions for the
>>>> database
>>>> structure, but their naming convention are rather tedious. So
>>>> typically I
>>>> create a global module that I use as a mapping file to create constants
>>>> with
>>>> more appropriate field and table names and map them to the table and
>>>> field
>>>> names required by the DB team. But now, using a DataList, I'm having a
>>>> problem. How can I use a variable name to indicate the field name in
>>>> the
>>>> HTML that's rendered by the DataList control?
>>>>
>>>> Rather than
>>>>
>>>> <%# DataBiner.Eval(Container.DataItem, "T003_EntityName_String") %>
>>>>
>>>> I want to use
>>>>
>>>> <%# DataBiner.Eval(Container.DataItem, EName) %>
>>>>
>>>> Where EName is a global var defined in a separate module.
>>>>
>>>> Is there a way to do this? I'm getting complaints that EName isn't a
>>>> valid
>>>> column name...
>>>>
>>>> Thanks.
>>>>
>>>> Jerry
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Bracketed types
    ... keywords of the intrinsic types of VB, the namespace containing the custom type is imported, and you want to ... Dim s As [String] ' Binds to the custom 'String' class. ... Using brackets in VB.NET helps with this and also to address conflicts with inherited keywords, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: XmlSerializer
    ... XmlSerializerNamespaces emptyNamespace = new XmlSerializerNamespaces; ... //Serialize the array, using the empty namespace ... > public class FormField { ... > public FormField(string Name, string Value) { ...
    (microsoft.public.dotnet.xml)
  • Re: Insert values into Table
    ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... string in code, and let me ask you a question as well. ... Is this column a date data type or a text string? ...
    (microsoft.public.access.modulesdaovba)
  • Re: XslTransform is not matching node when source XML contains an xmlns attribute
    ... >> in my XSLT. ... > element) are in the namespace with namespace URI ... > If you try to decode a byte stream like a memory stream to a string then ... > string yourself if all you want is a string, ...
    (microsoft.public.dotnet.xml)
  • Re: The Nature of God- String Theory
    ... Bosonic string theories are 26-dimensional, ... And so in HighSchoolMath (a namespace) we say "space is 3D because ... Fuller was present at the birth of "D talk" in the early 1900s. ... Ivory Towerites (i.e. we don't need their permission to roll out our ...
    (soc.religion.quaker)