473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Bind controls to class properties

How can I set/get values of a webform from the values of the properties of a
class? Does exist some function that do it?

gracias;)
Nov 18 '05 #1
4 1182
I am not sure I fully understand your request. Could you provide an example
scenario to better illustrate what you would like to do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Emanuele" <em********@telefonica.net> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
How can I set/get values of a webform from the values of the properties of a class? Does exist some function that do it?

gracias;)

Nov 18 '05 #2
Not 100% sure I understand, but you should be able to do:

VB.Net -->
<%# Ctype(Container.DataItem, YOURCLASS).PROPERTY %>

C#
<%# ((YOURCLASS)Container.DataItem).PROPERTY %>

You might need to <%@ Import NameSpace="namespace.of.your.class" %> at the
top

Karl

"Emanuele" <em********@telefonica.net> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
How can I set/get values of a webform from the values of the properties of a class? Does exist some function that do it?

gracias;)

Nov 18 '05 #3
ok.. it solves 50% of my problem... now I need to update values of my object
(all the properties of the class) from the values of the textboxes of my
page...

Example:

MyClass.Name ----> txtName.text
MyClass.Surname ----> txtSurname.text
MyClass.Address ----> txtAddress.text

thank's!
"Karl" <none> ha scritto nel messaggio
news:un**************@TK2MSFTNGP10.phx.gbl...
Not 100% sure I understand, but you should be able to do:

VB.Net -->
<%# Ctype(Container.DataItem, YOURCLASS).PROPERTY %>

C#
<%# ((YOURCLASS)Container.DataItem).PROPERTY %>

You might need to <%@ Import NameSpace="namespace.of.your.class" %> at the
top

Karl

"Emanuele" <em********@telefonica.net> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
How can I set/get values of a webform from the values of the properties
of a
class? Does exist some function that do it?

gracias;)


Nov 18 '05 #4
The only way to do that is manually as far as I know. When the save button
is hit, you need to get your object and manually update it

MyClass.Name = txtName.text

there's no mapping available.

Karl

"Emanuele" <em********@telefonica.net> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
ok.. it solves 50% of my problem... now I need to update values of my object (all the properties of the class) from the values of the textboxes of my
page...

Example:

MyClass.Name ----> txtName.text
MyClass.Surname ----> txtSurname.text
MyClass.Address ----> txtAddress.text

thank's!
"Karl" <none> ha scritto nel messaggio
news:un**************@TK2MSFTNGP10.phx.gbl...
Not 100% sure I understand, but you should be able to do:

VB.Net -->
<%# Ctype(Container.DataItem, YOURCLASS).PROPERTY %>

C#
<%# ((YOURCLASS)Container.DataItem).PROPERTY %>

You might need to <%@ Import NameSpace="namespace.of.your.class" %> at the top

Karl

"Emanuele" <em********@telefonica.net> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
How can I set/get values of a webform from the values of the
properties of
a
class? Does exist some function that do it?

gracias;)



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Julia | last post by:
class Document { Hashtable Properties ; //Key is the property name } class Media { Document document;
1
by: Jeff Smith | last post by:
Can I load custom web user controls dynamically and access the properties and methods without having to explicitly define custom control types (example 2 below). I have custom web control named...
1
by: Luis Esteban Valencia | last post by:
Please everybody participate in this question. Hello my applicacion has many layers and classes and I think its well structured. PLease let me know if you disagree and why. 1. I have the user...
4
by: XNoDE | last post by:
Hi all, VS.Net 2002. Is there a way to set default properties for controls in the Toolbox? There a some properties that I implement as standard in my apps and would like to get around...
1
by: john wright | last post by:
I have a dictionary oject I created and I want to bind a listbox to it. I am including the code for the dictionary object. Here is the error I am getting: "System.Exception: Complex...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
8
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a...
0
by: Hans Koller | last post by:
Hello group, I design a class to bind it to a property grid for easy modification of some settings. My problem is now that I want to raise an event when a settings has been changed. Thats not a...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.