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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Oops! I didn't notice the DatabaseColumn reference in the DataBind.Eval
statement. That makes more sense. Sorry.


"Scott M." <s-mar@xxxxxxxxxxxxx> wrote in message
news:uk7P9h5$FHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>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: Top kernel oopses/warnings this week
    ... terminate the oops printing with a defined string/uuid ... Printing the boot UUID ... as part of the end string resolves this ambiguity. ... void srandom32; ...
    (Linux-Kernel)
  • Re: edac_core: crashes on shutdown
    ... Am Mittwoch, den 01.12.2010, 20:35 +0100 schrieb Borislav Petkov: ... the important part being the "Not tainted" string. ... I only can get an oops with the end cut off or two oopses with the ...
    (Linux-Kernel)
  • Re: edac_core: crashes on shutdown
    ... the important part being the "Not tainted" string. ... I only can get an oops with the end cut off or two oopses with the ... inconclusive wrt EDAC. ... What edac modules are you using? ...
    (Linux-Kernel)
  • Re: Generic-Package Elaboration Question / Possible GNAT Bug.
    ... Oops, not good for its claims, an exemple DbC™ use case in this page is erroneous: ... put (x: ELEMENT; key: STRING) is ... a good candidate for a legitimate exception raise:p ...
    (comp.lang.ada)
  • Re: How can I know if a string is alphanumeric?
    ... >> How can I know if a string only has alfanumeric chars? ... > By feeding it to is_numeric: ... Oops, sorry, didn't read the question carefully... ...
    (comp.lang.php)