473,387 Members | 1,493 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,387 software developers and data experts.

Custom Controls

When using a custom control. In order to check and see if values have
changed one has to implement the IPostBackDataCollection interface. The
values returned for the control seem to be simply a string with comma
delimited values.

For example, if I were to render two text boxes. One with the Value Terry
and the Other with the Value 'Burns' I would get the following value

Terry,Burns.

I need this to be more like this

Forname,Terry,Surname,Burns. So I get get this into a key/Pair collection.

Is there something Im missing here, as I'm not sure how I can do this. I
tried rendering and ID name to see if this would generate this effect, but
it caused the event not to fire.

Any Ideas would be welcome.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Nov 18 '05 #1
21 2056
I resolved this by using Hidden Input tags, but there must be an easier
slicker way to do this?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
When using a custom control. In order to check and see if values have
changed one has to implement the IPostBackDataCollection interface. The
values returned for the control seem to be simply a string with comma
delimited values.

For example, if I were to render two text boxes. One with the Value Terry
and the Other with the Value 'Burns' I would get the following value

Terry,Burns.

I need this to be more like this

Forname,Terry,Surname,Burns. So I get get this into a key/Pair collection.
Is there something Im missing here, as I'm not sure how I can do this. I
tried rendering and ID name to see if this would generate this effect, but
it caused the event not to fire.

Any Ideas would be welcome.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Nov 18 '05 #2
Only the person who developed the custom Control can answer this question.
We don't have the source code.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
When using a custom control. In order to check and see if values have
changed one has to implement the IPostBackDataCollection interface. The
values returned for the control seem to be simply a string with comma
delimited values.

For example, if I were to render two text boxes. One with the Value Terry
and the Other with the Value 'Burns' I would get the following value

Terry,Burns.

I need this to be more like this

Forname,Terry,Surname,Burns. So I get get this into a key/Pair collection.
Is there something Im missing here, as I'm not sure how I can do this. I
tried rendering and ID name to see if this would generate this effect, but
it caused the event not to fire.

Any Ideas would be welcome.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Nov 18 '05 #3
Well that would be me.

My question is one of concept, not regarding the particular control in
question.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e7**************@TK2MSFTNGP10.phx.gbl...
Only the person who developed the custom Control can answer this question.
We don't have the source code.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:OA**************@TK2MSFTNGP10.phx.gbl...
When using a custom control. In order to check and see if values have
changed one has to implement the IPostBackDataCollection interface. The
values returned for the control seem to be simply a string with comma
delimited values.

For example, if I were to render two text boxes. One with the Value Terry and the Other with the Value 'Burns' I would get the following value

Terry,Burns.

I need this to be more like this

Forname,Terry,Surname,Burns. So I get get this into a key/Pair

collection.

Is there something Im missing here, as I'm not sure how I can do this. I
tried rendering and ID name to see if this would generate this effect, but it caused the event not to fire.

Any Ideas would be welcome.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .


Nov 18 '05 #4
> Well that would be me.

My question is one of concept, not regarding the particular control in
question.
In that case, can you tell us what you mean by "the values returned by the
Controls"? A Control is a class, and doesn't return a value. I'm sure you
mean something by this, but I can't figure out what.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:#w**************@TK2MSFTNGP10.phx.gbl... Well that would be me.

My question is one of concept, not regarding the particular control in
question.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e7**************@TK2MSFTNGP10.phx.gbl...
Only the person who developed the custom Control can answer this question.
We don't have the source code.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:OA**************@TK2MSFTNGP10.phx.gbl...
When using a custom control. In order to check and see if values have
changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a string with comma
delimited values.

For example, if I were to render two text boxes. One with the Value

Terry and the Other with the Value 'Burns' I would get the following value

Terry,Burns.

I need this to be more like this

Forname,Terry,Surname,Burns. So I get get this into a key/Pair

collection.

Is there something Im missing here, as I'm not sure how I can do this. I tried rendering and ID name to see if this would generate this effect, but it caused the event not to fire.

Any Ideas would be welcome.
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .



Nov 18 '05 #5
OK, lets try this one more time.

A custom control allows you to present itself any way you choose rendering
HTML. In the custom control I was writing, I simply wanted a number of text
boxes to return their data and persist in viewstate.

In order to facilitate this your control must implement the
IPostBackDataCollection interface. However, the following function returns
all the postback data from the web forms and allows you to get the data
specifically for your custom control.
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As System.Collections.Specialized.NameValueCollection ) As
Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

BUT. . . If you examine the returned value for your cc, this is simply a
number of string values for the elements of the control .

My question was this. Does a slicker way exist to get these values in a
value/pair collection or do we have to resort to adding hidden html fields
so that we can store the FieldName as well as the values. remember, ASP.NET
does not know about the controls within the CC.

Hope this explains a aliitle better
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:up*************@TK2MSFTNGP10.phx.gbl...
Well that would be me.

My question is one of concept, not regarding the particular control in
question.
In that case, can you tell us what you mean by "the values returned by the
Controls"? A Control is a class, and doesn't return a value. I'm sure you
mean something by this, but I can't figure out what.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message news:#w**************@TK2MSFTNGP10.phx.gbl...
Well that would be me.

My question is one of concept, not regarding the particular control in
question.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e7**************@TK2MSFTNGP10.phx.gbl...
Only the person who developed the custom Control can answer this question. We don't have the source code.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
> When using a custom control. In order to check and see if values have > changed one has to implement the IPostBackDataCollection interface. The > values returned for the control seem to be simply a string with comma > delimited values.
>
> For example, if I were to render two text boxes. One with the Value

Terry
> and the Other with the Value 'Burns' I would get the following value
>
> Terry,Burns.
>
> I need this to be more like this
>
> Forname,Terry,Surname,Burns. So I get get this into a key/Pair
collection.
>
> Is there something Im missing here, as I'm not sure how I can do
this. I > tried rendering and ID name to see if this would generate this
effect, but
> it caused the event not to fire.
>
> Any Ideas would be welcome.
>
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
>



Nov 18 '05 #6
Actually, that function returns a boolean value, either True or False.
Again, I'm having some trouble understanding your question. However, I have
written some articles on developing custom Server Controls, which may help:

http://www.takempis.com/aspnet_fundamentals.asp
http://www.takempis.com/aspnet_controls.asp
http://www.takempis.com/aspnet_anatomy1.asp
http://www.takempis.com/aspnet_anatomy2.asp
http://www.takempis.com/aspnet_anatomy3.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:ua**************@TK2MSFTNGP10.phx.gbl...
OK, lets try this one more time.

A custom control allows you to present itself any way you choose rendering
HTML. In the custom control I was writing, I simply wanted a number of text boxes to return their data and persist in viewstate.

In order to facilitate this your control must implement the
IPostBackDataCollection interface. However, the following function returns
all the postback data from the web forms and allows you to get the data
specifically for your custom control.
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As System.Collections.Specialized.NameValueCollection ) As
Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

BUT. . . If you examine the returned value for your cc, this is simply a
number of string values for the elements of the control .

My question was this. Does a slicker way exist to get these values in a
value/pair collection or do we have to resort to adding hidden html fields
so that we can store the FieldName as well as the values. remember, ASP.NET does not know about the controls within the CC.

Hope this explains a aliitle better
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:up*************@TK2MSFTNGP10.phx.gbl...
Well that would be me.

My question is one of concept, not regarding the particular control in
question.


In that case, can you tell us what you mean by "the values returned by the
Controls"? A Control is a class, and doesn't return a value. I'm sure you mean something by this, but I can't figure out what.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:#w**************@TK2MSFTNGP10.phx.gbl...
Well that would be me.

My question is one of concept, not regarding the particular control in
question.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e7**************@TK2MSFTNGP10.phx.gbl...
> Only the person who developed the custom Control can answer this

question.
> We don't have the source code.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:OA**************@TK2MSFTNGP10.phx.gbl...
> > When using a custom control. In order to check and see if values have > > changed one has to implement the IPostBackDataCollection interface. The
> > values returned for the control seem to be simply a string with comma > > delimited values.
> >
> > For example, if I were to render two text boxes. One with the
Value Terry
> > and the Other with the Value 'Burns' I would get the following value > >
> > Terry,Burns.
> >
> > I need this to be more like this
> >
> > Forname,Terry,Surname,Burns. So I get get this into a key/Pair
> collection.
> >
> > Is there something Im missing here, as I'm not sure how I can do

this.
I
> > tried rendering and ID name to see if this would generate this

effect, but
> > it caused the event not to fire.
> >
> > Any Ideas would be welcome.
> >
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> >
>
>



Nov 18 '05 #7
No no, I'm not refering to the Return value of the function , I'm refering
to the values passed TO the function which contain the data for the control.

postCollection(PostDataKey) is passed, the key is the ID of the control and
the data value in the collection is a string containing the HTML element
values. So if you have two text boxes with values of Me and You, then
returned is "Me,You"

Now do you see what Im driving at ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Actually, that function returns a boolean value, either True or False.
Again, I'm having some trouble understanding your question. However, I have written some articles on developing custom Server Controls, which may help:
http://www.takempis.com/aspnet_fundamentals.asp
http://www.takempis.com/aspnet_controls.asp
http://www.takempis.com/aspnet_anatomy1.asp
http://www.takempis.com/aspnet_anatomy2.asp
http://www.takempis.com/aspnet_anatomy3.asp

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:ua**************@TK2MSFTNGP10.phx.gbl...
OK, lets try this one more time.

A custom control allows you to present itself any way you choose rendering
HTML. In the custom control I was writing, I simply wanted a number of

text
boxes to return their data and persist in viewstate.

In order to facilitate this your control must implement the
IPostBackDataCollection interface. However, the following function returns all the postback data from the web forms and allows you to get the data
specifically for your custom control.
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As System.Collections.Specialized.NameValueCollection ) As
Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

BUT. . . If you examine the returned value for your cc, this is simply a
number of string values for the elements of the control .

My question was this. Does a slicker way exist to get these values in a
value/pair collection or do we have to resort to adding hidden html fields so that we can store the FieldName as well as the values. remember,

ASP.NET
does not know about the controls within the CC.

Hope this explains a aliitle better
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:up*************@TK2MSFTNGP10.phx.gbl...
> Well that would be me.
>
> My question is one of concept, not regarding the particular control in > question.

In that case, can you tell us what you mean by "the values returned by

the Controls"? A Control is a class, and doesn't return a value. I'm sure you mean something by this, but I can't figure out what.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:#w**************@TK2MSFTNGP10.phx.gbl...
> Well that would be me.
>
> My question is one of concept, not regarding the particular control in > question.
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:e7**************@TK2MSFTNGP10.phx.gbl...
> > Only the person who developed the custom Control can answer this
question.
> > We don't have the source code.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in > message
> > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > When using a custom control. In order to check and see if values

have
> > > changed one has to implement the IPostBackDataCollection interface. The
> > > values returned for the control seem to be simply a string with

comma
> > > delimited values.
> > >
> > > For example, if I were to render two text boxes. One with the Value > Terry
> > > and the Other with the Value 'Burns' I would get the following value > > >
> > > Terry,Burns.
> > >
> > > I need this to be more like this
> > >
> > > Forname,Terry,Surname,Burns. So I get get this into a key/Pair
> > collection.
> > >
> > > Is there something Im missing here, as I'm not sure how I can do

this.
I
> > > tried rendering and ID name to see if this would generate this

effect,
> but
> > > it caused the event not to fire.
> > >
> > > Any Ideas would be welcome.
> > >
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #8
PS. Thanks for trying to help anyway, it's appreciated.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Actually, that function returns a boolean value, either True or False.
Again, I'm having some trouble understanding your question. However, I have written some articles on developing custom Server Controls, which may help:
http://www.takempis.com/aspnet_fundamentals.asp
http://www.takempis.com/aspnet_controls.asp
http://www.takempis.com/aspnet_anatomy1.asp
http://www.takempis.com/aspnet_anatomy2.asp
http://www.takempis.com/aspnet_anatomy3.asp

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:ua**************@TK2MSFTNGP10.phx.gbl...
OK, lets try this one more time.

A custom control allows you to present itself any way you choose rendering
HTML. In the custom control I was writing, I simply wanted a number of

text
boxes to return their data and persist in viewstate.

In order to facilitate this your control must implement the
IPostBackDataCollection interface. However, the following function returns all the postback data from the web forms and allows you to get the data
specifically for your custom control.
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As System.Collections.Specialized.NameValueCollection ) As
Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

BUT. . . If you examine the returned value for your cc, this is simply a
number of string values for the elements of the control .

My question was this. Does a slicker way exist to get these values in a
value/pair collection or do we have to resort to adding hidden html fields so that we can store the FieldName as well as the values. remember,

ASP.NET
does not know about the controls within the CC.

Hope this explains a aliitle better
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:up*************@TK2MSFTNGP10.phx.gbl...
> Well that would be me.
>
> My question is one of concept, not regarding the particular control in > question.

In that case, can you tell us what you mean by "the values returned by

the Controls"? A Control is a class, and doesn't return a value. I'm sure you mean something by this, but I can't figure out what.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:#w**************@TK2MSFTNGP10.phx.gbl...
> Well that would be me.
>
> My question is one of concept, not regarding the particular control in > question.
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:e7**************@TK2MSFTNGP10.phx.gbl...
> > Only the person who developed the custom Control can answer this
question.
> > We don't have the source code.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in > message
> > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > When using a custom control. In order to check and see if values

have
> > > changed one has to implement the IPostBackDataCollection interface. The
> > > values returned for the control seem to be simply a string with

comma
> > > delimited values.
> > >
> > > For example, if I were to render two text boxes. One with the Value > Terry
> > > and the Other with the Value 'Burns' I would get the following value > > >
> > > Terry,Burns.
> > >
> > > I need this to be more like this
> > >
> > > Forname,Terry,Surname,Burns. So I get get this into a key/Pair
> > collection.
> > >
> > > Is there something Im missing here, as I'm not sure how I can do

this.
I
> > > tried rendering and ID name to see if this would generate this

effect,
> but
> > > it caused the event not to fire.
> > >
> > > Any Ideas would be welcome.
> > >
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #9
If you have 2 textboxes coming into the PostDataCollection as a single
comma-delimited item, they must have the same "name" attribute on the
client. The HTML form posts the data in the form as name/value pairs, using
the "name" attribute of the client-side form field to link the data with the
form field on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:#Y**************@TK2MSFTNGP11.phx.gbl...
No no, I'm not refering to the Return value of the function , I'm refering
to the values passed TO the function which contain the data for the control.
postCollection(PostDataKey) is passed, the key is the ID of the control and the data value in the collection is a string containing the HTML element
values. So if you have two text boxes with values of Me and You, then
returned is "Me,You"

Now do you see what Im driving at ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Actually, that function returns a boolean value, either True or False.
Again, I'm having some trouble understanding your question. However, I have
written some articles on developing custom Server Controls, which may

help:

http://www.takempis.com/aspnet_fundamentals.asp
http://www.takempis.com/aspnet_controls.asp
http://www.takempis.com/aspnet_anatomy1.asp
http://www.takempis.com/aspnet_anatomy2.asp
http://www.takempis.com/aspnet_anatomy3.asp

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:ua**************@TK2MSFTNGP10.phx.gbl...
OK, lets try this one more time.

A custom control allows you to present itself any way you choose rendering HTML. In the custom control I was writing, I simply wanted a number of
text
boxes to return their data and persist in viewstate.

In order to facilitate this your control must implement the
IPostBackDataCollection interface. However, the following function returns all the postback data from the web forms and allows you to get the
data specifically for your custom control.
Public Function LoadPostData(ByVal postDataKey As String, ByVal
postCollection As System.Collections.Specialized.NameValueCollection ) As Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

BUT. . . If you examine the returned value for your cc, this is simply a number of string values for the elements of the control .

My question was this. Does a slicker way exist to get these values in a value/pair collection or do we have to resort to adding hidden html fields so that we can store the FieldName as well as the values. remember,

ASP.NET
does not know about the controls within the CC.

Hope this explains a aliitle better
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:up*************@TK2MSFTNGP10.phx.gbl...
> > Well that would be me.
> >
> > My question is one of concept, not regarding the particular control in
> > question.
>
> In that case, can you tell us what you mean by "the values returned
by the
> Controls"? A Control is a class, and doesn't return a value. I'm
sure you
> mean something by this, but I can't figure out what.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:#w**************@TK2MSFTNGP10.phx.gbl...
> > Well that would be me.
> >
> > My question is one of concept, not regarding the particular
control in > > question.
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > Only the person who developed the custom Control can answer this
> question.
> > > We don't have the source code.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>
wrote
in > > message
> > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > When using a custom control. In order to check and see if

values have
> > > > changed one has to implement the IPostBackDataCollection

interface.
> The
> > > > values returned for the control seem to be simply a string with comma
> > > > delimited values.
> > > >
> > > > For example, if I were to render two text boxes. One with the

Value
> > Terry
> > > > and the Other with the Value 'Burns' I would get the following

value
> > > >
> > > > Terry,Burns.
> > > >
> > > > I need this to be more like this
> > > >
> > > > Forname,Terry,Surname,Burns. So I get get this into a key/Pair > > > collection.
> > > >
> > > > Is there something Im missing here, as I'm not sure how I can do this.
> I
> > > > tried rendering and ID name to see if this would generate this
effect,
> > but
> > > > it caused the event not to fire.
> > > >
> > > > Any Ideas would be welcome.
> > > >
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #10
kevin,
I do appreciate your help here, but we seem to have some kind of
disconnect. Either I am functionally inoperative or we simply dont
understand each other.

PostDataCollection(PostDataKey) returns the CustomControl data. This is just
a string of concatenated strings.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
If you have 2 textboxes coming into the PostDataCollection as a single
comma-delimited item, they must have the same "name" attribute on the
client. The HTML form posts the data in the form as name/value pairs, using the "name" attribute of the client-side form field to link the data with the form field on the client.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:#Y**************@TK2MSFTNGP11.phx.gbl...
No no, I'm not refering to the Return value of the function , I'm refering
to the values passed TO the function which contain the data for the control.

postCollection(PostDataKey) is passed, the key is the ID of the control

and
the data value in the collection is a string containing the HTML element
values. So if you have two text boxes with values of Me and You, then
returned is "Me,You"

Now do you see what Im driving at ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
Actually, that function returns a boolean value, either True or False.
Again, I'm having some trouble understanding your question. However, I

have
written some articles on developing custom Server Controls, which may

help:

http://www.takempis.com/aspnet_fundamentals.asp
http://www.takempis.com/aspnet_controls.asp
http://www.takempis.com/aspnet_anatomy1.asp
http://www.takempis.com/aspnet_anatomy2.asp
http://www.takempis.com/aspnet_anatomy3.asp

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:ua**************@TK2MSFTNGP10.phx.gbl...
> OK, lets try this one more time.
>
> A custom control allows you to present itself any way you choose

rendering
> HTML. In the custom control I was writing, I simply wanted a number

of text
> boxes to return their data and persist in viewstate.
>
> In order to facilitate this your control must implement the
> IPostBackDataCollection interface. However, the following function

returns
> all the postback data from the web forms and allows you to get the data > specifically for your custom control.
> Public Function LoadPostData(ByVal postDataKey As String, ByVal
> postCollection As System.Collections.Specialized.NameValueCollection ) As
> Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData
>
> BUT. . . If you examine the returned value for your cc, this is
simply
a > number of string values for the elements of the control .
>
> My question was this. Does a slicker way exist to get these values
in
a > value/pair collection or do we have to resort to adding hidden html fields
> so that we can store the FieldName as well as the values. remember,
ASP.NET
> does not know about the controls within the CC.
>
> Hope this explains a aliitle better
>
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:up*************@TK2MSFTNGP10.phx.gbl...
> > > Well that would be me.
> > >
> > > My question is one of concept, not regarding the particular control
in
> > > question.
> >
> > In that case, can you tell us what you mean by "the values

returned by the
> > Controls"? A Control is a class, and doesn't return a value. I'm sure you
> > mean something by this, but I can't figure out what.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in > message
> > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > Well that would be me.
> > >
> > > My question is one of concept, not regarding the particular
control
in
> > > question.
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > Only the person who developed the custom Control can answer this > > question.
> > > > We don't have the source code.
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > .Net Developer
> > > > Microsoft MVP
> > > > Big things are made up
> > > > of lots of little things.
> > > >
> > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote
in
> > > message
> > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > When using a custom control. In order to check and see if

values > have
> > > > > changed one has to implement the IPostBackDataCollection
interface.
> > The
> > > > > values returned for the control seem to be simply a string with > comma
> > > > > delimited values.
> > > > >
> > > > > For example, if I were to render two text boxes. One with the Value
> > > Terry
> > > > > and the Other with the Value 'Burns' I would get the following value
> > > > >
> > > > > Terry,Burns.
> > > > >
> > > > > I need this to be more like this
> > > > >
> > > > > Forname,Terry,Surname,Burns. So I get get this into a key/Pair > > > > collection.
> > > > >
> > > > > Is there something Im missing here, as I'm not sure how I can do
> this.
> > I
> > > > > tried rendering and ID name to see if this would generate

this > effect,
> > > but
> > > > > it caused the event not to fire.
> > > > >
> > > > > Any Ideas would be welcome.
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > OHM ( Terry Burns )
> > > > > . . . One-Handed-Man . . .
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #11
The PostDataCollection is simply a Collection of the form field data posted
by the client form. HTML Form data is posted using name=value pairs. If a
single entry (PostDataCollection(PostDataKey) is a single entry) contains
more than one value, delimited by one or more commas, it contains the values
of more than one form field having the same name attribute on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
kevin,
I do appreciate your help here, but we seem to have some kind of disconnect. Either I am functionally inoperative or we simply dont
understand each other.

PostDataCollection(PostDataKey) returns the CustomControl data. This is just a string of concatenated strings.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
If you have 2 textboxes coming into the PostDataCollection as a single
comma-delimited item, they must have the same "name" attribute on the
client. The HTML form posts the data in the form as name/value pairs, using
the "name" attribute of the client-side form field to link the data with

the
form field on the client.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:#Y**************@TK2MSFTNGP11.phx.gbl...
No no, I'm not refering to the Return value of the function , I'm refering to the values passed TO the function which contain the data for the

control.

postCollection(PostDataKey) is passed, the key is the ID of the control
and
the data value in the collection is a string containing the HTML
element values. So if you have two text boxes with values of Me and You, then
returned is "Me,You"

Now do you see what Im driving at ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:Oo**************@TK2MSFTNGP10.phx.gbl...
> Actually, that function returns a boolean value, either True or False. > Again, I'm having some trouble understanding your question. However, I have
> written some articles on developing custom Server Controls, which may help:
>
> http://www.takempis.com/aspnet_fundamentals.asp
> http://www.takempis.com/aspnet_controls.asp
> http://www.takempis.com/aspnet_anatomy1.asp
> http://www.takempis.com/aspnet_anatomy2.asp
> http://www.takempis.com/aspnet_anatomy3.asp
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:ua**************@TK2MSFTNGP10.phx.gbl...
> > OK, lets try this one more time.
> >
> > A custom control allows you to present itself any way you choose
rendering
> > HTML. In the custom control I was writing, I simply wanted a number
of
> text
> > boxes to return their data and persist in viewstate.
> >
> > In order to facilitate this your control must implement the
> > IPostBackDataCollection interface. However, the following function
returns
> > all the postback data from the web forms and allows you to get the

data
> > specifically for your custom control.
> > Public Function LoadPostData(ByVal postDataKey As String, ByVal
> > postCollection As

System.Collections.Specialized.NameValueCollection )
As
> > Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData
> >
> > BUT. . . If you examine the returned value for your cc, this is

simply
a
> > number of string values for the elements of the control .
> >
> > My question was this. Does a slicker way exist to get these values

in
a
> > value/pair collection or do we have to resort to adding hidden

html fields
> > so that we can store the FieldName as well as the values. remember, > ASP.NET
> > does not know about the controls within the CC.
> >
> > Hope this explains a aliitle better
> >
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > Well that would be me.
> > > >
> > > > My question is one of concept, not regarding the particular

control
in
> > > > question.
> > >
> > > In that case, can you tell us what you mean by "the values

returned
by
> the
> > > Controls"? A Control is a class, and doesn't return a value. I'm

sure
> you
> > > mean something by this, but I can't figure out what.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote in > > message
> > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > Well that would be me.
> > > >
> > > > My question is one of concept, not regarding the particular

control
in
> > > > question.
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > >
> > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > Only the person who developed the custom Control can answer this > > > question.
> > > > > We don't have the source code.
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > .Net Developer
> > > > > Microsoft MVP
> > > > > Big things are made up
> > > > > of lots of little things.
> > > > >
> > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote
in
> > > > message
> > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > When using a custom control. In order to check and see if

values
> > have
> > > > > > changed one has to implement the IPostBackDataCollection
> interface.
> > > The
> > > > > > values returned for the control seem to be simply a string

with
> > comma
> > > > > > delimited values.
> > > > > >
> > > > > > For example, if I were to render two text boxes. One with the > Value
> > > > Terry
> > > > > > and the Other with the Value 'Burns' I would get the following > value
> > > > > >
> > > > > > Terry,Burns.
> > > > > >
> > > > > > I need this to be more like this
> > > > > >
> > > > > > Forname,Terry,Surname,Burns. So I get get this into a

key/Pair
> > > > > collection.
> > > > > >
> > > > > > Is there something Im missing here, as I'm not sure how I can
do
> > this.
> > > I
> > > > > > tried rendering and ID name to see if this would generate

this > > effect,
> > > > but
> > > > > > it caused the event not to fire.
> > > > > >
> > > > > > Any Ideas would be welcome.
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > OHM ( Terry Burns )
> > > > > > . . . One-Handed-Man . . .
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #12
Hi Kevin, Thanks for coming back on this one.

Yes, correct !

Now, we have arrived at the understanding, the question is that I was hoping
that this data could be represented as value/key pairs. To better illustrate
what I mean, lets say we take this string and split it and make use of its
elements in our code on the host form.

What if we need to change the layout of our custom control ?, this means we
have to go back and re-jig the code. If however, we could arrange things so
that the ID of the Field allways preceeded the value, we could create a
collection of key/Value pairs in their own right, thus freeing us from the
concerns about layout and modifications.

And thats what I'm after !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
The PostDataCollection is simply a Collection of the form field data posted by the client form. HTML Form data is posted using name=value pairs. If a
single entry (PostDataCollection(PostDataKey) is a single entry) contains
more than one value, delimited by one or more commas, it contains the values of more than one form field having the same name attribute on the client.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:uf**************@TK2MSFTNGP09.phx.gbl...
kevin,
I do appreciate your help here, but we seem to have some kind of
disconnect. Either I am functionally inoperative or we simply dont
understand each other.

PostDataCollection(PostDataKey) returns the CustomControl data. This is

just
a string of concatenated strings.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
If you have 2 textboxes coming into the PostDataCollection as a single
comma-delimited item, they must have the same "name" attribute on the
client. The HTML form posts the data in the form as name/value pairs,

using
the "name" attribute of the client-side form field to link the data with
the
form field on the client.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:#Y**************@TK2MSFTNGP11.phx.gbl...
> No no, I'm not refering to the Return value of the function , I'm

refering
> to the values passed TO the function which contain the data for the
control.
>
> postCollection(PostDataKey) is passed, the key is the ID of the control and
> the data value in the collection is a string containing the HTML element > values. So if you have two text boxes with values of Me and You,
then > returned is "Me,You"
>
> Now do you see what Im driving at ?
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > Actually, that function returns a boolean value, either True or False. > > Again, I'm having some trouble understanding your question. However, I
> have
> > written some articles on developing custom Server Controls, which may > help:
> >
> > http://www.takempis.com/aspnet_fundamentals.asp
> > http://www.takempis.com/aspnet_controls.asp
> > http://www.takempis.com/aspnet_anatomy1.asp
> > http://www.takempis.com/aspnet_anatomy2.asp
> > http://www.takempis.com/aspnet_anatomy3.asp
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in > message
> > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > OK, lets try this one more time.
> > >
> > > A custom control allows you to present itself any way you choose
> rendering
> > > HTML. In the custom control I was writing, I simply wanted a

number of
> > text
> > > boxes to return their data and persist in viewstate.
> > >
> > > In order to facilitate this your control must implement the
> > > IPostBackDataCollection interface. However, the following function > returns
> > > all the postback data from the web forms and allows you to get the data
> > > specifically for your custom control.
> > > Public Function LoadPostData(ByVal postDataKey As String, ByVal
> > > postCollection As

System.Collections.Specialized.NameValueCollection )
As
> > > Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData > > >
> > > BUT. . . If you examine the returned value for your cc, this is

simply
a
> > > number of string values for the elements of the control .
> > >
> > > My question was this. Does a slicker way exist to get these values in
a
> > > value/pair collection or do we have to resort to adding hidden html > fields
> > > so that we can store the FieldName as well as the values. remember, > > ASP.NET
> > > does not know about the controls within the CC.
> > >
> > > Hope this explains a aliitle better
> > >
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > Well that would be me.
> > > > >
> > > > > My question is one of concept, not regarding the particular
control
> in
> > > > > question.
> > > >
> > > > In that case, can you tell us what you mean by "the values

returned
by
> > the
> > > > Controls"? A Control is a class, and doesn't return a value.
I'm sure
> > you
> > > > mean something by this, but I can't figure out what.
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > .Net Developer
> > > > Microsoft MVP
> > > > Big things are made up
> > > > of lots of little things.
> > > >
> > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote
in
> > > message
> > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > Well that would be me.
> > > > >
> > > > > My question is one of concept, not regarding the particular
control
> in
> > > > > question.
> > > > >
> > > > > --
> > > > >
> > > > > OHM ( Terry Burns )
> > > > > . . . One-Handed-Man . . .
> > > > >
> > > > >
> > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Only the person who developed the custom Control can answer this
> > > > question.
> > > > > > We don't have the source code.
> > > > > >
> > > > > > --
> > > > > > HTH,
> > > > > > Kevin Spencer
> > > > > > .Net Developer
> > > > > > Microsoft MVP
> > > > > > Big things are made up
> > > > > > of lots of little things.
> > > > > >
> > > > > > "One Handed Man ( OHM - Terry Burns )"
<news.microsoft.com> wrote
> in
> > > > > message
> > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > When using a custom control. In order to check and see if values
> > > have
> > > > > > > changed one has to implement the IPostBackDataCollection
> > interface.
> > > > The
> > > > > > > values returned for the control seem to be simply a string with
> > > comma
> > > > > > > delimited values.
> > > > > > >
> > > > > > > For example, if I were to render two text boxes. One

with the
> > Value
> > > > > Terry
> > > > > > > and the Other with the Value 'Burns' I would get the

following
> > value
> > > > > > >
> > > > > > > Terry,Burns.
> > > > > > >
> > > > > > > I need this to be more like this
> > > > > > >
> > > > > > > Forname,Terry,Surname,Burns. So I get get this into a
key/Pair
> > > > > > collection.
> > > > > > >
> > > > > > > Is there something Im missing here, as I'm not sure how
I can
do
> > > this.
> > > > I
> > > > > > > tried rendering and ID name to see if this would
generate this
> > > effect,
> > > > > but
> > > > > > > it caused the event not to fire.
> > > > > > >
> > > > > > > Any Ideas would be welcome.
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > OHM ( Terry Burns )
> > > > > > > . . . One-Handed-Man . . .
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #13
I'mnot following you there, Terry. However, I CAN tell you that having a
single Control having multiple form fields in it with the same name
attribute is a mistake, as the rules of HTML is not something Microsoft has
any control over.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
Hi Kevin, Thanks for coming back on this one.

Yes, correct !

Now, we have arrived at the understanding, the question is that I was hoping that this data could be represented as value/key pairs. To better illustrate what I mean, lets say we take this string and split it and make use of its
elements in our code on the host form.

What if we need to change the layout of our custom control ?, this means we have to go back and re-jig the code. If however, we could arrange things so that the ID of the Field allways preceeded the value, we could create a
collection of key/Value pairs in their own right, thus freeing us from the
concerns about layout and modifications.

And thats what I'm after !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
The PostDataCollection is simply a Collection of the form field data posted
by the client form. HTML Form data is posted using name=value pairs. If a
single entry (PostDataCollection(PostDataKey) is a single entry) contains more than one value, delimited by one or more commas, it contains the

values
of more than one form field having the same name attribute on the client.
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:uf**************@TK2MSFTNGP09.phx.gbl...
kevin,
I do appreciate your help here, but we seem to have some kind
of
disconnect. Either I am functionally inoperative or we simply dont
understand each other.

PostDataCollection(PostDataKey) returns the CustomControl data. This
is just
a string of concatenated strings.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
> If you have 2 textboxes coming into the PostDataCollection as a
single > comma-delimited item, they must have the same "name" attribute on the > client. The HTML form posts the data in the form as name/value pairs, using
> the "name" attribute of the client-side form field to link the data

with the
> form field on the client.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:#Y**************@TK2MSFTNGP11.phx.gbl...
> > No no, I'm not refering to the Return value of the function , I'm
refering
> > to the values passed TO the function which contain the data for the > control.
> >
> > postCollection(PostDataKey) is passed, the key is the ID of the

control
> and
> > the data value in the collection is a string containing the HTML

element
> > values. So if you have two text boxes with values of Me and You, then > > returned is "Me,You"
> >
> > Now do you see what Im driving at ?
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > > Actually, that function returns a boolean value, either True or

False.
> > > Again, I'm having some trouble understanding your question. However,
I
> > have
> > > written some articles on developing custom Server Controls, which may
> > help:
> > >
> > > http://www.takempis.com/aspnet_fundamentals.asp
> > > http://www.takempis.com/aspnet_controls.asp
> > > http://www.takempis.com/aspnet_anatomy1.asp
> > > http://www.takempis.com/aspnet_anatomy2.asp
> > > http://www.takempis.com/aspnet_anatomy3.asp
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote in > > message
> > > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > > OK, lets try this one more time.
> > > >
> > > > A custom control allows you to present itself any way you
choose > > rendering
> > > > HTML. In the custom control I was writing, I simply wanted a number
> of
> > > text
> > > > boxes to return their data and persist in viewstate.
> > > >
> > > > In order to facilitate this your control must implement the
> > > > IPostBackDataCollection interface. However, the following

function > > returns
> > > > all the postback data from the web forms and allows you to get the > data
> > > > specifically for your custom control.
> > > > Public Function LoadPostData(ByVal postDataKey As String, ByVal > > > > postCollection As
System.Collections.Specialized.NameValueCollection )
> As
> > > > Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData > > > >
> > > > BUT. . . If you examine the returned value for your cc, this is simply
> a
> > > > number of string values for the elements of the control .
> > > >
> > > > My question was this. Does a slicker way exist to get these values in
> a
> > > > value/pair collection or do we have to resort to adding hidden

html
> > fields
> > > > so that we can store the FieldName as well as the values.

remember,
> > > ASP.NET
> > > > does not know about the controls within the CC.
> > > >
> > > > Hope this explains a aliitle better
> > > >
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > >
> > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > > Well that would be me.
> > > > > >
> > > > > > My question is one of concept, not regarding the particular > control
> > in
> > > > > > question.
> > > > >
> > > > > In that case, can you tell us what you mean by "the values
returned
> by
> > > the
> > > > > Controls"? A Control is a class, and doesn't return a value. I'm > sure
> > > you
> > > > > mean something by this, but I can't figure out what.
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > .Net Developer
> > > > > Microsoft MVP
> > > > > Big things are made up
> > > > > of lots of little things.
> > > > >
> > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote
in
> > > > message
> > > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Well that would be me.
> > > > > >
> > > > > > My question is one of concept, not regarding the particular > control
> > in
> > > > > > question.
> > > > > >
> > > > > > --
> > > > > >
> > > > > > OHM ( Terry Burns )
> > > > > > . . . One-Handed-Man . . .
> > > > > >
> > > > > >
> > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > Only the person who developed the custom Control can answer this
> > > > > question.
> > > > > > > We don't have the source code.
> > > > > > >
> > > > > > > --
> > > > > > > HTH,
> > > > > > > Kevin Spencer
> > > > > > > .Net Developer
> > > > > > > Microsoft MVP
> > > > > > > Big things are made up
> > > > > > > of lots of little things.
> > > > > > >
> > > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> > wrote
> > in
> > > > > > message
> > > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > When using a custom control. In order to check and see if > values
> > > > have
> > > > > > > > changed one has to implement the IPostBackDataCollection > > > interface.
> > > > > The
> > > > > > > > values returned for the control seem to be simply a string > with
> > > > comma
> > > > > > > > delimited values.
> > > > > > > >
> > > > > > > > For example, if I were to render two text boxes. One with the
> > > Value
> > > > > > Terry
> > > > > > > > and the Other with the Value 'Burns' I would get the
following
> > > value
> > > > > > > >
> > > > > > > > Terry,Burns.
> > > > > > > >
> > > > > > > > I need this to be more like this
> > > > > > > >
> > > > > > > > Forname,Terry,Surname,Burns. So I get get this into a
> key/Pair
> > > > > > > collection.
> > > > > > > >
> > > > > > > > Is there something Im missing here, as I'm not sure
how I can
> do
> > > > this.
> > > > > I
> > > > > > > > tried rendering and ID name to see if this would generate this
> > > > effect,
> > > > > > but
> > > > > > > > it caused the event not to fire.
> > > > > > > >
> > > > > > > > Any Ideas would be welcome.
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > >
> > > > > > > > OHM ( Terry Burns )
> > > > > > > > . . . One-Handed-Man . . .
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #14
No, they are not the same name. My Senario . . .

--- MY Custom Control -- - -

<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

--------------------------------
The output from the control ( value ) in the PostBackCollection(MyControlID)
is

"MyFirstName,MyAddress"



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'mnot following you there, Terry. However, I CAN tell you that having a
single Control having multiple form fields in it with the same name
attribute is a mistake, as the rules of HTML is not something Microsoft has any control over.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:Oc**************@TK2MSFTNGP11.phx.gbl...
Hi Kevin, Thanks for coming back on this one.

Yes, correct !

Now, we have arrived at the understanding, the question is that I was hoping
that this data could be represented as value/key pairs. To better

illustrate
what I mean, lets say we take this string and split it and make use of its
elements in our code on the host form.

What if we need to change the layout of our custom control ?, this means

we
have to go back and re-jig the code. If however, we could arrange things

so
that the ID of the Field allways preceeded the value, we could create a
collection of key/Value pairs in their own right, thus freeing us from the concerns about layout and modifications.

And thats what I'm after !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
The PostDataCollection is simply a Collection of the form field data

posted
by the client form. HTML Form data is posted using name=value pairs. If a single entry (PostDataCollection(PostDataKey) is a single entry) contains more than one value, delimited by one or more commas, it contains the

values
of more than one form field having the same name attribute on the client.
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:uf**************@TK2MSFTNGP09.phx.gbl...
> kevin,
> I do appreciate your help here, but we seem to have some kind of
> disconnect. Either I am functionally inoperative or we simply dont
> understand each other.
>
> PostDataCollection(PostDataKey) returns the CustomControl data. This is just
> a string of concatenated strings.
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:e%***************@TK2MSFTNGP11.phx.gbl...
> > If you have 2 textboxes coming into the PostDataCollection as a single > > comma-delimited item, they must have the same "name" attribute on the > > client. The HTML form posts the data in the form as name/value pairs, > using
> > the "name" attribute of the client-side form field to link the
data
with
> the
> > form field on the client.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in > message
> > news:#Y**************@TK2MSFTNGP11.phx.gbl...
> > > No no, I'm not refering to the Return value of the function , I'm > refering
> > > to the values passed TO the function which contain the data for

the > > control.
> > >
> > > postCollection(PostDataKey) is passed, the key is the ID of the
control
> > and
> > > the data value in the collection is a string containing the HTML
element
> > > values. So if you have two text boxes with values of Me and You,

then
> > > returned is "Me,You"
> > >
> > > Now do you see what Im driving at ?
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > > > Actually, that function returns a boolean value, either True or False.
> > > > Again, I'm having some trouble understanding your question.

However,
I
> > > have
> > > > written some articles on developing custom Server Controls, which may
> > > help:
> > > >
> > > > http://www.takempis.com/aspnet_fundamentals.asp
> > > > http://www.takempis.com/aspnet_controls.asp
> > > > http://www.takempis.com/aspnet_anatomy1.asp
> > > > http://www.takempis.com/aspnet_anatomy2.asp
> > > > http://www.takempis.com/aspnet_anatomy3.asp
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > .Net Developer
> > > > Microsoft MVP
> > > > Big things are made up
> > > > of lots of little things.
> > > >
> > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in
> > > message
> > > > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > > > OK, lets try this one more time.
> > > > >
> > > > > A custom control allows you to present itself any way you

choose > > > rendering
> > > > > HTML. In the custom control I was writing, I simply wanted a number
> > of
> > > > text
> > > > > boxes to return their data and persist in viewstate.
> > > > >
> > > > > In order to facilitate this your control must implement the
> > > > > IPostBackDataCollection interface. However, the following

function
> > > returns
> > > > > all the postback data from the web forms and allows you to get the
> > data
> > > > > specifically for your custom control.
> > > > > Public Function LoadPostData(ByVal postDataKey As String, ByVal > > > > > postCollection As
> System.Collections.Specialized.NameValueCollection )
> > As
> > > > > Boolean Implements

System.Web.UI.IPostBackDataHandler.LoadPostData
> > > > >
> > > > > BUT. . . If you examine the returned value for your cc, this is > simply
> > a
> > > > > number of string values for the elements of the control .
> > > > >
> > > > > My question was this. Does a slicker way exist to get these

values
> in
> > a
> > > > > value/pair collection or do we have to resort to adding
hidden html
> > > fields
> > > > > so that we can store the FieldName as well as the values.
remember,
> > > > ASP.NET
> > > > > does not know about the controls within the CC.
> > > > >
> > > > > Hope this explains a aliitle better
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > OHM ( Terry Burns )
> > > > > . . . One-Handed-Man . . .
> > > > >
> > > > >
> > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > > > Well that would be me.
> > > > > > >
> > > > > > > My question is one of concept, not regarding the particular > > control
> > > in
> > > > > > > question.
> > > > > >
> > > > > > In that case, can you tell us what you mean by "the values
> returned
> > by
> > > > the
> > > > > > Controls"? A Control is a class, and doesn't return a value. I'm
> > sure
> > > > you
> > > > > > mean something by this, but I can't figure out what.
> > > > > >
> > > > > > --
> > > > > > HTH,
> > > > > > Kevin Spencer
> > > > > > .Net Developer
> > > > > > Microsoft MVP
> > > > > > Big things are made up
> > > > > > of lots of little things.
> > > > > >
> > > > > > "One Handed Man ( OHM - Terry Burns )"
<news.microsoft.com> wrote
> in
> > > > > message
> > > > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > Well that would be me.
> > > > > > >
> > > > > > > My question is one of concept, not regarding the particular > > control
> > > in
> > > > > > > question.
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > OHM ( Terry Burns )
> > > > > > > . . . One-Handed-Man . . .
> > > > > > >
> > > > > > >
> > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > Only the person who developed the custom Control can

answer
> this
> > > > > > question.
> > > > > > > > We don't have the source code.
> > > > > > > >
> > > > > > > > --
> > > > > > > > HTH,
> > > > > > > > Kevin Spencer
> > > > > > > > .Net Developer
> > > > > > > > Microsoft MVP
> > > > > > > > Big things are made up
> > > > > > > > of lots of little things.
> > > > > > > >
> > > > > > > > "One Handed Man ( OHM - Terry Burns )"

<news.microsoft.com>
> > wrote
> > > in
> > > > > > > message
> > > > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > When using a custom control. In order to check and see if
> > values
> > > > > have
> > > > > > > > > changed one has to implement the IPostBackDataCollection > > > > interface.
> > > > > > The
> > > > > > > > > values returned for the control seem to be simply a

string
> > with
> > > > > comma
> > > > > > > > > delimited values.
> > > > > > > > >
> > > > > > > > > For example, if I were to render two text boxes. One

with
> the
> > > > Value
> > > > > > > Terry
> > > > > > > > > and the Other with the Value 'Burns' I would get the
> following
> > > > value
> > > > > > > > >
> > > > > > > > > Terry,Burns.
> > > > > > > > >
> > > > > > > > > I need this to be more like this
> > > > > > > > >
> > > > > > > > > Forname,Terry,Surname,Burns. So I get get this into

a > > key/Pair
> > > > > > > > collection.
> > > > > > > > >
> > > > > > > > > Is there something Im missing here, as I'm not sure

how
I
> can
> > do
> > > > > this.
> > > > > > I
> > > > > > > > > tried rendering and ID name to see if this would

generate
> this
> > > > > effect,
> > > > > > > but
> > > > > > > > > it caused the event not to fire.
> > > > > > > > >
> > > > > > > > > Any Ideas would be welcome.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > >
> > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #15
The id attribute is not the name attribute.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:O4**************@TK2MSFTNGP11.phx.gbl...
No, they are not the same name. My Senario . . .

--- MY Custom Control -- - -

<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

--------------------------------
The output from the control ( value ) in the PostBackCollection(MyControlID) is

"MyFirstName,MyAddress"



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'mnot following you there, Terry. However, I CAN tell you that having a
single Control having multiple form fields in it with the same name
attribute is a mistake, as the rules of HTML is not something Microsoft has
any control over.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
Hi Kevin, Thanks for coming back on this one.

Yes, correct !

Now, we have arrived at the understanding, the question is that I was

hoping
that this data could be represented as value/key pairs. To better

illustrate
what I mean, lets say we take this string and split it and make use of its elements in our code on the host form.

What if we need to change the layout of our custom control ?, this means
we
have to go back and re-jig the code. If however, we could arrange
things
so
that the ID of the Field allways preceeded the value, we could create
a collection of key/Value pairs in their own right, thus freeing us from

the concerns about layout and modifications.

And thats what I'm after !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
> The PostDataCollection is simply a Collection of the form field data
posted
> by the client form. HTML Form data is posted using name=value pairs. If
a
> single entry (PostDataCollection(PostDataKey) is a single entry)

contains
> more than one value, delimited by one or more commas, it contains the values
> of more than one form field having the same name attribute on the

client.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:uf**************@TK2MSFTNGP09.phx.gbl...
> > kevin,
> > I do appreciate your help here, but we seem to have some kind
> of
> > disconnect. Either I am functionally inoperative or we simply dont
> > understand each other.
> >
> > PostDataCollection(PostDataKey) returns the CustomControl data.
This is
> just
> > a string of concatenated strings.
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:e%***************@TK2MSFTNGP11.phx.gbl...
> > > If you have 2 textboxes coming into the PostDataCollection as a

single
> > > comma-delimited item, they must have the same "name" attribute
on the
> > > client. The HTML form posts the data in the form as name/value

pairs,
> > using
> > > the "name" attribute of the client-side form field to link the data with
> > the
> > > form field on the client.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>
wrote in > > message
> > > news:#Y**************@TK2MSFTNGP11.phx.gbl...
> > > > No no, I'm not refering to the Return value of the function , I'm > > refering
> > > > to the values passed TO the function which contain the data
for the
> > > control.
> > > >
> > > > postCollection(PostDataKey) is passed, the key is the ID of
the > control
> > > and
> > > > the data value in the collection is a string containing the HTML > element
> > > > values. So if you have two text boxes with values of Me and You, then
> > > > returned is "Me,You"
> > > >
> > > > Now do you see what Im driving at ?
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > >
> > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > > > > Actually, that function returns a boolean value, either True
or > False.
> > > > > Again, I'm having some trouble understanding your question.
However,
> I
> > > > have
> > > > > written some articles on developing custom Server Controls,

which
> may
> > > > help:
> > > > >
> > > > > http://www.takempis.com/aspnet_fundamentals.asp
> > > > > http://www.takempis.com/aspnet_controls.asp
> > > > > http://www.takempis.com/aspnet_anatomy1.asp
> > > > > http://www.takempis.com/aspnet_anatomy2.asp
> > > > > http://www.takempis.com/aspnet_anatomy3.asp
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > .Net Developer
> > > > > Microsoft MVP
> > > > > Big things are made up
> > > > > of lots of little things.
> > > > >
> > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com>

wrote
in
> > > > message
> > > > > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > > > > OK, lets try this one more time.
> > > > > >
> > > > > > A custom control allows you to present itself any way you

choose
> > > > rendering
> > > > > > HTML. In the custom control I was writing, I simply wanted a
> number
> > > of
> > > > > text
> > > > > > boxes to return their data and persist in viewstate.
> > > > > >
> > > > > > In order to facilitate this your control must implement
the > > > > > > IPostBackDataCollection interface. However, the following
function
> > > > returns
> > > > > > all the postback data from the web forms and allows you to
get the
> > > data
> > > > > > specifically for your custom control.
> > > > > > Public Function LoadPostData(ByVal postDataKey As String,

ByVal
> > > > > > postCollection As
> > System.Collections.Specialized.NameValueCollection )
> > > As
> > > > > > Boolean Implements
System.Web.UI.IPostBackDataHandler.LoadPostData
> > > > > >
> > > > > > BUT. . . If you examine the returned value for your cc, this is
> > simply
> > > a
> > > > > > number of string values for the elements of the control .
> > > > > >
> > > > > > My question was this. Does a slicker way exist to get
these values
> > in
> > > a
> > > > > > value/pair collection or do we have to resort to adding hidden > html
> > > > fields
> > > > > > so that we can store the FieldName as well as the values.
> remember,
> > > > > ASP.NET
> > > > > > does not know about the controls within the CC.
> > > > > >
> > > > > > Hope this explains a aliitle better
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > OHM ( Terry Burns )
> > > > > > . . . One-Handed-Man . . .
> > > > > >
> > > > > >
> > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > Well that would be me.
> > > > > > > >
> > > > > > > > My question is one of concept, not regarding the

particular
> > > control
> > > > in
> > > > > > > > question.
> > > > > > >
> > > > > > > In that case, can you tell us what you mean by "the values > > returned
> > > by
> > > > > the
> > > > > > > Controls"? A Control is a class, and doesn't return a value. I'm
> > > sure
> > > > > you
> > > > > > > mean something by this, but I can't figure out what.
> > > > > > >
> > > > > > > --
> > > > > > > HTH,
> > > > > > > Kevin Spencer
> > > > > > > .Net Developer
> > > > > > > Microsoft MVP
> > > > > > > Big things are made up
> > > > > > > of lots of little things.
> > > > > > >
> > > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> > wrote
> > in
> > > > > > message
> > > > > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > Well that would be me.
> > > > > > > >
> > > > > > > > My question is one of concept, not regarding the

particular
> > > control
> > > > in
> > > > > > > > question.
> > > > > > > >
> > > > > > > > --
> > > > > > > >
> > > > > > > > OHM ( Terry Burns )
> > > > > > > > . . . One-Handed-Man . . .
> > > > > > > >
> > > > > > > >
> > > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message > > > > > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > Only the person who developed the custom Control can
answer
> > this
> > > > > > > question.
> > > > > > > > > We don't have the source code.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > HTH,
> > > > > > > > > Kevin Spencer
> > > > > > > > > .Net Developer
> > > > > > > > > Microsoft MVP
> > > > > > > > > Big things are made up
> > > > > > > > > of lots of little things.
> > > > > > > > >
> > > > > > > > > "One Handed Man ( OHM - Terry Burns )"
<news.microsoft.com>
> > > wrote
> > > > in
> > > > > > > > message
> > > > > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > When using a custom control. In order to check and see if
> > > values
> > > > > > have
> > > > > > > > > > changed one has to implement the

IPostBackDataCollection
> > > > > interface.
> > > > > > > The
> > > > > > > > > > values returned for the control seem to be simply a string
> > > with
> > > > > > comma
> > > > > > > > > > delimited values.
> > > > > > > > > >
> > > > > > > > > > For example, if I were to render two text boxes. One with
> > the
> > > > > Value
> > > > > > > > Terry
> > > > > > > > > > and the Other with the Value 'Burns' I would get the > > following
> > > > > value
> > > > > > > > > >
> > > > > > > > > > Terry,Burns.
> > > > > > > > > >
> > > > > > > > > > I need this to be more like this
> > > > > > > > > >
> > > > > > > > > > Forname,Terry,Surname,Burns. So I get get this
into a > > > key/Pair
> > > > > > > > > collection.
> > > > > > > > > >
> > > > > > > > > > Is there something Im missing here, as I'm not

sure how
I
> > can
> > > do
> > > > > > this.
> > > > > > > I
> > > > > > > > > > tried rendering and ID name to see if this would
generate
> > this
> > > > > > effect,
> > > > > > > > but
> > > > > > > > > > it caused the event not to fire.
> > > > > > > > > >
> > > > > > > > > > Any Ideas would be welcome.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > >
> > > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #16
OK, typo, by you know what I meant dont you ?

Tell you what Kevin, I'll go figure this for myself. Thanks for your help
anyways !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
The id attribute is not the name attribute.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message news:O4**************@TK2MSFTNGP11.phx.gbl...
No, they are not the same name. My Senario . . .

--- MY Custom Control -- - -

<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

--------------------------------
The output from the control ( value ) in the PostBackCollection(MyControlID)
is

"MyFirstName,MyAddress"



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I'mnot following you there, Terry. However, I CAN tell you that having a single Control having multiple form fields in it with the same name
attribute is a mistake, as the rules of HTML is not something Microsoft
has
any control over.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in

message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
> Hi Kevin, Thanks for coming back on this one.
>
> Yes, correct !
>
> Now, we have arrived at the understanding, the question is that I
was hoping
> that this data could be represented as value/key pairs. To better
illustrate
> what I mean, lets say we take this string and split it and make use of
its
> elements in our code on the host form.
>
> What if we need to change the layout of our custom control ?, this means we
> have to go back and re-jig the code. If however, we could arrange things so
> that the ID of the Field allways preceeded the value, we could
create a > collection of key/Value pairs in their own right, thus freeing us
from the
> concerns about layout and modifications.
>
> And thats what I'm after !
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
>
> "Kevin Spencer" <ks******@takempis.com> wrote in message
> news:ec**************@TK2MSFTNGP10.phx.gbl...
> > The PostDataCollection is simply a Collection of the form field
data > posted
> > by the client form. HTML Form data is posted using name=value pairs. If
a
> > single entry (PostDataCollection(PostDataKey) is a single entry)
contains
> > more than one value, delimited by one or more commas, it contains the > values
> > of more than one form field having the same name attribute on the
client.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in > message
> > news:uf**************@TK2MSFTNGP09.phx.gbl...
> > > kevin,
> > > I do appreciate your help here, but we seem to have
some kind
> > of
> > > disconnect. Either I am functionally inoperative or we simply dont > > > understand each other.
> > >
> > > PostDataCollection(PostDataKey) returns the CustomControl data. This is
> > just
> > > a string of concatenated strings.
> > >
> > > --
> > >
> > > OHM ( Terry Burns )
> > > . . . One-Handed-Man . . .
> > >
> > >
> > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > news:e%***************@TK2MSFTNGP11.phx.gbl...
> > > > If you have 2 textboxes coming into the PostDataCollection as a single
> > > > comma-delimited item, they must have the same "name" attribute on the
> > > > client. The HTML form posts the data in the form as name/value
pairs,
> > > using
> > > > the "name" attribute of the client-side form field to link the

data
> with
> > > the
> > > > form field on the client.
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > .Net Developer
> > > > Microsoft MVP
> > > > Big things are made up
> > > > of lots of little things.
> > > >
> > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in
> > > message
> > > > news:#Y**************@TK2MSFTNGP11.phx.gbl...
> > > > > No no, I'm not refering to the Return value of the function , I'm
> > > refering
> > > > > to the values passed TO the function which contain the data for the
> > > > control.
> > > > >
> > > > > postCollection(PostDataKey) is passed, the key is the ID of the > > control
> > > > and
> > > > > the data value in the collection is a string containing the HTML > > element
> > > > > values. So if you have two text boxes with values of Me and You, > then
> > > > > returned is "Me,You"
> > > > >
> > > > > Now do you see what Im driving at ?
> > > > >
> > > > > --
> > > > >
> > > > > OHM ( Terry Burns )
> > > > > . . . One-Handed-Man . . .
> > > > >
> > > > >
> > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Actually, that function returns a boolean value, either
True or
> > False.
> > > > > > Again, I'm having some trouble understanding your
question. > However,
> > I
> > > > > have
> > > > > > written some articles on developing custom Server Controls, which
> > may
> > > > > help:
> > > > > >
> > > > > > http://www.takempis.com/aspnet_fundamentals.asp
> > > > > > http://www.takempis.com/aspnet_controls.asp
> > > > > > http://www.takempis.com/aspnet_anatomy1.asp
> > > > > > http://www.takempis.com/aspnet_anatomy2.asp
> > > > > > http://www.takempis.com/aspnet_anatomy3.asp
> > > > > >
> > > > > > --
> > > > > > HTH,
> > > > > > Kevin Spencer
> > > > > > .Net Developer
> > > > > > Microsoft MVP
> > > > > > Big things are made up
> > > > > > of lots of little things.
> > > > > >
> > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
> in
> > > > > message
> > > > > > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > OK, lets try this one more time.
> > > > > > >
> > > > > > > A custom control allows you to present itself any way you choose
> > > > > rendering
> > > > > > > HTML. In the custom control I was writing, I simply

wanted
a
> > number
> > > > of
> > > > > > text
> > > > > > > boxes to return their data and persist in viewstate.
> > > > > > >
> > > > > > > In order to facilitate this your control must implement

the > > > > > > > IPostBackDataCollection interface. However, the following > function
> > > > > returns
> > > > > > > all the postback data from the web forms and allows you to get
> the
> > > > data
> > > > > > > specifically for your custom control.
> > > > > > > Public Function LoadPostData(ByVal postDataKey As
String, ByVal
> > > > > > > postCollection As
> > > System.Collections.Specialized.NameValueCollection )
> > > > As
> > > > > > > Boolean Implements
> System.Web.UI.IPostBackDataHandler.LoadPostData
> > > > > > >
> > > > > > > BUT. . . If you examine the returned value for your cc, this is
> > > simply
> > > > a
> > > > > > > number of string values for the elements of the control .. > > > > > > >
> > > > > > > My question was this. Does a slicker way exist to get these > values
> > > in
> > > > a
> > > > > > > value/pair collection or do we have to resort to adding

hidden
> > html
> > > > > fields
> > > > > > > so that we can store the FieldName as well as the values. > > remember,
> > > > > > ASP.NET
> > > > > > > does not know about the controls within the CC.
> > > > > > >
> > > > > > > Hope this explains a aliitle better
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > OHM ( Terry Burns )
> > > > > > > . . . One-Handed-Man . . .
> > > > > > >
> > > > > > >
> > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > Well that would be me.
> > > > > > > > >
> > > > > > > > > My question is one of concept, not regarding the
particular
> > > > control
> > > > > in
> > > > > > > > > question.
> > > > > > > >
> > > > > > > > In that case, can you tell us what you mean by "the values > > > returned
> > > > by
> > > > > > the
> > > > > > > > Controls"? A Control is a class, and doesn't return a

value.
> I'm
> > > > sure
> > > > > > you
> > > > > > > > mean something by this, but I can't figure out what.
> > > > > > > >
> > > > > > > > --
> > > > > > > > HTH,
> > > > > > > > Kevin Spencer
> > > > > > > > .Net Developer
> > > > > > > > Microsoft MVP
> > > > > > > > Big things are made up
> > > > > > > > of lots of little things.
> > > > > > > >
> > > > > > > > "One Handed Man ( OHM - Terry Burns )"

<news.microsoft.com>
> > wrote
> > > in
> > > > > > > message
> > > > > > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > Well that would be me.
> > > > > > > > >
> > > > > > > > > My question is one of concept, not regarding the
particular
> > > > control
> > > > > in
> > > > > > > > > question.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > >
> > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message > > > > > > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > Only the person who developed the custom Control can > answer
> > > this
> > > > > > > > question.
> > > > > > > > > > We don't have the source code.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > HTH,
> > > > > > > > > > Kevin Spencer
> > > > > > > > > > .Net Developer
> > > > > > > > > > Microsoft MVP
> > > > > > > > > > Big things are made up
> > > > > > > > > > of lots of little things.
> > > > > > > > > >
> > > > > > > > > > "One Handed Man ( OHM - Terry Burns )"
> <news.microsoft.com>
> > > > wrote
> > > > > in
> > > > > > > > > message
> > > > > > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > > When using a custom control. In order to check
and see
> if
> > > > values
> > > > > > > have
> > > > > > > > > > > changed one has to implement the
IPostBackDataCollection
> > > > > > interface.
> > > > > > > > The
> > > > > > > > > > > values returned for the control seem to be

simply a > string
> > > > with
> > > > > > > comma
> > > > > > > > > > > delimited values.
> > > > > > > > > > >
> > > > > > > > > > > For example, if I were to render two text boxes. One > with
> > > the
> > > > > > Value
> > > > > > > > > Terry
> > > > > > > > > > > and the Other with the Value 'Burns' I would get the > > > following
> > > > > > value
> > > > > > > > > > >
> > > > > > > > > > > Terry,Burns.
> > > > > > > > > > >
> > > > > > > > > > > I need this to be more like this
> > > > > > > > > > >
> > > > > > > > > > > Forname,Terry,Surname,Burns. So I get get this into
a
> > > > key/Pair
> > > > > > > > > > collection.
> > > > > > > > > > >
> > > > > > > > > > > Is there something Im missing here, as I'm not

sure how
> I
> > > can
> > > > do
> > > > > > > this.
> > > > > > > > I
> > > > > > > > > > > tried rendering and ID name to see if this would
> generate
> > > this
> > > > > > > effect,
> > > > > > > > > but
> > > > > > > > > > > it caused the event not to fire.
> > > > > > > > > > >
> > > > > > > > > > > Any Ideas would be welcome.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > >
> > > > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #17
Sorry, OHM, I don't know what anyone means except what they say. Too many
years programming, I suppose. Best of luck to you!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:#M**************@TK2MSFTNGP12.phx.gbl...
OK, typo, by you know what I meant dont you ?

Tell you what Kevin, I'll go figure this for myself. Thanks for your help
anyways !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
The id attribute is not the name attribute.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:O4**************@TK2MSFTNGP11.phx.gbl...
No, they are not the same name. My Senario . . .

--- MY Custom Control -- - -

<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

--------------------------------
The output from the control ( value ) in the

PostBackCollection(MyControlID)
is

"MyFirstName,MyAddress"



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> I'mnot following you there, Terry. However, I CAN tell you that having a
> single Control having multiple form fields in it with the same name
> attribute is a mistake, as the rules of HTML is not something Microsoft has
> any control over.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message
> news:Oc**************@TK2MSFTNGP11.phx.gbl...
> > Hi Kevin, Thanks for coming back on this one.
> >
> > Yes, correct !
> >
> > Now, we have arrived at the understanding, the question is that I was > hoping
> > that this data could be represented as value/key pairs. To better
> illustrate
> > what I mean, lets say we take this string and split it and make
use
of its
> > elements in our code on the host form.
> >
> > What if we need to change the layout of our custom control ?, this means
> we
> > have to go back and re-jig the code. If however, we could arrange

things
> so
> > that the ID of the Field allways preceeded the value, we could create
a
> > collection of key/Value pairs in their own right, thus freeing us from the
> > concerns about layout and modifications.
> >
> > And thats what I'm after !
> >
> > --
> >
> > OHM ( Terry Burns )
> > . . . One-Handed-Man . . .
> >
> >
> > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > news:ec**************@TK2MSFTNGP10.phx.gbl...
> > > The PostDataCollection is simply a Collection of the form field data > > posted
> > > by the client form. HTML Form data is posted using name=value pairs. If
> a
> > > single entry (PostDataCollection(PostDataKey) is a single entry)
> contains
> > > more than one value, delimited by one or more commas, it
contains the
> > values
> > > of more than one form field having the same name attribute on
the > client.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > .Net Developer
> > > Microsoft MVP
> > > Big things are made up
> > > of lots of little things.
> > >
> > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in > > message
> > > news:uf**************@TK2MSFTNGP09.phx.gbl...
> > > > kevin,
> > > > I do appreciate your help here, but we seem to have some
> kind
> > > of
> > > > disconnect. Either I am functionally inoperative or we simply dont > > > > understand each other.
> > > >
> > > > PostDataCollection(PostDataKey) returns the CustomControl
data. This
> is
> > > just
> > > > a string of concatenated strings.
> > > >
> > > > --
> > > >
> > > > OHM ( Terry Burns )
> > > > . . . One-Handed-Man . . .
> > > >
> > > >
> > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > news:e%***************@TK2MSFTNGP11.phx.gbl...
> > > > > If you have 2 textboxes coming into the PostDataCollection
as a > single
> > > > > comma-delimited item, they must have the same "name"
attribute on
> the
> > > > > client. The HTML form posts the data in the form as
name/value > pairs,
> > > > using
> > > > > the "name" attribute of the client-side form field to link the data
> > with
> > > > the
> > > > > form field on the client.
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > .Net Developer
> > > > > Microsoft MVP
> > > > > Big things are made up
> > > > > of lots of little things.
> > > > >
> > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote
in
> > > > message
> > > > > news:#Y**************@TK2MSFTNGP11.phx.gbl...
> > > > > > No no, I'm not refering to the Return value of the function , I'm
> > > > refering
> > > > > > to the values passed TO the function which contain the
data for
> the
> > > > > control.
> > > > > >
> > > > > > postCollection(PostDataKey) is passed, the key is the ID
of the
> > > control
> > > > > and
> > > > > > the data value in the collection is a string containing
the HTML
> > > element
> > > > > > values. So if you have two text boxes with values of Me
and You,
> > then
> > > > > > returned is "Me,You"
> > > > > >
> > > > > > Now do you see what Im driving at ?
> > > > > >
> > > > > > --
> > > > > >
> > > > > > OHM ( Terry Burns )
> > > > > > . . . One-Handed-Man . . .
> > > > > >
> > > > > >
> > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message
> > > > > > news:Oo**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > Actually, that function returns a boolean value, either True or
> > > False.
> > > > > > > Again, I'm having some trouble understanding your question. > > However,
> > > I
> > > > > > have
> > > > > > > written some articles on developing custom Server Controls, > which
> > > may
> > > > > > help:
> > > > > > >
> > > > > > > http://www.takempis.com/aspnet_fundamentals.asp
> > > > > > > http://www.takempis.com/aspnet_controls.asp
> > > > > > > http://www.takempis.com/aspnet_anatomy1.asp
> > > > > > > http://www.takempis.com/aspnet_anatomy2.asp
> > > > > > > http://www.takempis.com/aspnet_anatomy3.asp
> > > > > > >
> > > > > > > --
> > > > > > > HTH,
> > > > > > > Kevin Spencer
> > > > > > > .Net Developer
> > > > > > > Microsoft MVP
> > > > > > > Big things are made up
> > > > > > > of lots of little things.
> > > > > > >
> > > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> > wrote
> > in
> > > > > > message
> > > > > > > news:ua**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > OK, lets try this one more time.
> > > > > > > >
> > > > > > > > A custom control allows you to present itself any way you > choose
> > > > > > rendering
> > > > > > > > HTML. In the custom control I was writing, I simply wanted
a
> > > number
> > > > > of
> > > > > > > text
> > > > > > > > boxes to return their data and persist in viewstate.
> > > > > > > >
> > > > > > > > In order to facilitate this your control must
implement the
> > > > > > > > IPostBackDataCollection interface. However, the following > > function
> > > > > > returns
> > > > > > > > all the postback data from the web forms and allows
you to get
> > the
> > > > > data
> > > > > > > > specifically for your custom control.
> > > > > > > > Public Function LoadPostData(ByVal postDataKey As String, > ByVal
> > > > > > > > postCollection As
> > > > System.Collections.Specialized.NameValueCollection )
> > > > > As
> > > > > > > > Boolean Implements
> > System.Web.UI.IPostBackDataHandler.LoadPostData
> > > > > > > >
> > > > > > > > BUT. . . If you examine the returned value for your
cc, this
> is
> > > > simply
> > > > > a
> > > > > > > > number of string values for the elements of the
control
. > > > > > > > >
> > > > > > > > My question was this. Does a slicker way exist to get

these
> > values
> > > > in
> > > > > a
> > > > > > > > value/pair collection or do we have to resort to
adding hidden
> > > html
> > > > > > fields
> > > > > > > > so that we can store the FieldName as well as the

values. > > > remember,
> > > > > > > ASP.NET
> > > > > > > > does not know about the controls within the CC.
> > > > > > > >
> > > > > > > > Hope this explains a aliitle better
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > >
> > > > > > > > OHM ( Terry Burns )
> > > > > > > > . . . One-Handed-Man . . .
> > > > > > > >
> > > > > > > >
> > > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in message > > > > > > > > news:up*************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > Well that would be me.
> > > > > > > > > >
> > > > > > > > > > My question is one of concept, not regarding the
> particular
> > > > > control
> > > > > > in
> > > > > > > > > > question.
> > > > > > > > >
> > > > > > > > > In that case, can you tell us what you mean by "the

values
> > > > returned
> > > > > by
> > > > > > > the
> > > > > > > > > Controls"? A Control is a class, and doesn't return a value.
> > I'm
> > > > > sure
> > > > > > > you
> > > > > > > > > mean something by this, but I can't figure out what.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > HTH,
> > > > > > > > > Kevin Spencer
> > > > > > > > > .Net Developer
> > > > > > > > > Microsoft MVP
> > > > > > > > > Big things are made up
> > > > > > > > > of lots of little things.
> > > > > > > > >
> > > > > > > > > "One Handed Man ( OHM - Terry Burns )"
<news.microsoft.com>
> > > wrote
> > > > in
> > > > > > > > message
> > > > > > > > > news:#w**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > Well that would be me.
> > > > > > > > > >
> > > > > > > > > > My question is one of concept, not regarding the
> particular
> > > > > control
> > > > > > in
> > > > > > > > > > question.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > >
> > > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > "Kevin Spencer" <ks******@takempis.com> wrote in

message
> > > > > > > > > > news:e7**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > > Only the person who developed the custom Control can > > answer
> > > > this
> > > > > > > > > question.
> > > > > > > > > > > We don't have the source code.
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > HTH,
> > > > > > > > > > > Kevin Spencer
> > > > > > > > > > > .Net Developer
> > > > > > > > > > > Microsoft MVP
> > > > > > > > > > > Big things are made up
> > > > > > > > > > > of lots of little things.
> > > > > > > > > > >
> > > > > > > > > > > "One Handed Man ( OHM - Terry Burns )"
> > <news.microsoft.com>
> > > > > wrote
> > > > > > in
> > > > > > > > > > message
> > > > > > > > > > > news:OA**************@TK2MSFTNGP10.phx.gbl...
> > > > > > > > > > > > When using a custom control. In order to check and see
> > if
> > > > > values
> > > > > > > > have
> > > > > > > > > > > > changed one has to implement the
> IPostBackDataCollection
> > > > > > > interface.
> > > > > > > > > The
> > > > > > > > > > > > values returned for the control seem to be

simply
a
> > string
> > > > > with
> > > > > > > > comma
> > > > > > > > > > > > delimited values.
> > > > > > > > > > > >
> > > > > > > > > > > > For example, if I were to render two text boxes. One
> > with
> > > > the
> > > > > > > Value
> > > > > > > > > > Terry
> > > > > > > > > > > > and the Other with the Value 'Burns' I would
get the
> > > > following
> > > > > > > value
> > > > > > > > > > > >
> > > > > > > > > > > > Terry,Burns.
> > > > > > > > > > > >
> > > > > > > > > > > > I need this to be more like this
> > > > > > > > > > > >
> > > > > > > > > > > > Forname,Terry,Surname,Burns. So I get get
this into
a
> > > > > key/Pair
> > > > > > > > > > > collection.
> > > > > > > > > > > >
> > > > > > > > > > > > Is there something Im missing here, as I'm not

sure
> how
> > I
> > > > can
> > > > > do
> > > > > > > > this.
> > > > > > > > > I
> > > > > > > > > > > > tried rendering and ID name to see if this

would > > generate
> > > > this
> > > > > > > > effect,
> > > > > > > > > > but
> > > > > > > > > > > > it caused the event not to fire.
> > > > > > > > > > > >
> > > > > > > > > > > > Any Ideas would be welcome.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > >
> > > > > > > > > > > > OHM ( Terry Burns )
> > > > > > > > > > > > . . . One-Handed-Man . . .
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #18
The name attribute is used by the client, and is posted back to the server
by the client. The id attribute is used on the server to uniquely identify
the Control. Again, it is a mistake to create a Custom Server Control that
always has the same name attribute on the client, for the very reason that
we've been going round and round about. As this is a Custom Server Control,
you, the developer, are fully in charge of how it renders on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jeff Evans" <Jeff Ev***@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com...
"One Handed Man ( OHM - Terry Burns )" wrote:
OK, typo, by you know what I meant dont you ?

Tell you what Kevin, I'll go figure this for myself. Thanks for your help anyways !
I've been following this thread and I think I know exactly what you're

talking about. I have the same problem. To outline my understanding of the
issue here:
You have a custom control, called MyControl. You want to implement IPostBackDataHandler for this control, so that it make use of LoadPostData
and possibly RaisePostDataChangedEvent. The problem is, these events will
only be called if the runtime finds something in the form with the "name"
attribute matching the UniqueID of this instantiation of the control
MyControl. This could be something like (in my present case) "_ct10".
Fine, but what if we want to post *multiple* values with this control, and
have potentially multiple "postDataKey" values for the same control? Is
this even possible? Is there a better way to handle this than splitting the
returned value for postCollection["_ct10"] by a comma (clearly this is a
problem if submitted values HAVE commas themselves)?
Let's go back to the example you mentioned some time ago with:
<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

Now for both of these inputs to have their values properly received in the LoadPostData of the form, on submit, they would have to be assigned the same
"name" attribute (say, "_ct10"), correct? This is the only way the runtime
knows *this* data was intended for *this* control. But this of course poses
a problem, as we've already seen.
what is the proper way of submitting multiple form values for the same custom control, and having each one properly resolve itself in LoadPostData?
Is it even possible? (Come to think of it, the only examples I've seen of
this in use are somewhat trivial cases with just one input).
Any help is appreciated, and OHM, I'll let you know if I discover

anything. Thanks!
Nov 18 '05 #19
BTW, here is an excellent and comprehensive reference on the Microsoft MSDN
Library, which you can study in case you haven't downloaded the free .Net
SDK:

http://msdn.microsoft.com/library/en...asp?frame=true

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jeff Evans" <Jeff Ev***@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com...
"One Handed Man ( OHM - Terry Burns )" wrote:
OK, typo, by you know what I meant dont you ?

Tell you what Kevin, I'll go figure this for myself. Thanks for your help anyways !
I've been following this thread and I think I know exactly what you're

talking about. I have the same problem. To outline my understanding of the
issue here:
You have a custom control, called MyControl. You want to implement IPostBackDataHandler for this control, so that it make use of LoadPostData
and possibly RaisePostDataChangedEvent. The problem is, these events will
only be called if the runtime finds something in the form with the "name"
attribute matching the UniqueID of this instantiation of the control
MyControl. This could be something like (in my present case) "_ct10".
Fine, but what if we want to post *multiple* values with this control, and
have potentially multiple "postDataKey" values for the same control? Is
this even possible? Is there a better way to handle this than splitting the
returned value for postCollection["_ct10"] by a comma (clearly this is a
problem if submitted values HAVE commas themselves)?
Let's go back to the example you mentioned some time ago with:
<Input id=txtName . . . . . value="MyFirstName">
<Input id=txtAddress . . . . .value="MyAddress">

Now for both of these inputs to have their values properly received in the LoadPostData of the form, on submit, they would have to be assigned the same
"name" attribute (say, "_ct10"), correct? This is the only way the runtime
knows *this* data was intended for *this* control. But this of course poses
a problem, as we've already seen.
what is the proper way of submitting multiple form values for the same custom control, and having each one properly resolve itself in LoadPostData?
Is it even possible? (Come to think of it, the only examples I've seen of
this in use are somewhat trivial cases with just one input).
Any help is appreciated, and OHM, I'll let you know if I discover

anything. Thanks!
Nov 18 '05 #20
> BTW, here is an excellent and comprehensive reference on the Microsoft MSDN
Library, which you can study in case you haven't downloaded the free .Net
SDK:

http://msdn.microsoft.com/library/en...asp?frame=true


That is an excellent resource I haven't run across yet, thank you. It clarifies a lot of things. I just have one more question, that isn't even really important to development. Does the NameValueCollection "values" (or whatever you call it) that is a parameter to LoadPostData() contain *all* the key/value pairs for the entire page (entire form), and not just those associated with the control on which the method is called? That's the impression I get from reading the "Composition vs. Rendering" article at:

http://msdn.microsoft.com/library/de...srendering.asp

If so, does that mean that in the LoadPostData for, say, MyControl, you could potentially read key/value pairs intended for other controls? Just curious. Thank you for your time.
Nov 18 '05 #21
Hi Jeff,

Remember that ASP.Net is a means of working with and rendering HTML. If you
understand how HTML works, you've got half of ASP.Net figured out (the easy
half!). A PostBack is simply an HTML form posting itself to the same URL it
came from, and the server-side objects handle the Request. In HTML, a form
posts all form fields contained within it, including hidden form fields. So,
the answer to your very good question is, The PostDataCollection is a
NameValueCollection (object) which is formed by getting all the names and
all the values posted by the form, and putting them into this Collection.
The postDataKey parameter is the name of the form field which caused the
Post. It is obtained by checking the hidden __EventTarget form field which
ASP.Net adds to the form. It uses JavaScript on the client to set the value
of this hidden form field and posting the form. As long as you knew the
client-side name attribute of any form field, you could extract its value by
invoking postCollection["FormFieldName"].

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jeff Evans" <Je*******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
BTW, here is an excellent and comprehensive reference on the Microsoft MSDN Library, which you can study in case you haven't downloaded the free ..Net SDK:
http://msdn.microsoft.com/library/en...asp?frame=true
That is an excellent resource I haven't run across yet, thank you. It clarifies a lot of things. I just have one more question, that isn't even
really important to development. Does the NameValueCollection "values" (or
whatever you call it) that is a parameter to LoadPostData() contain *all*
the key/value pairs for the entire page (entire form), and not just those
associated with the control on which the method is called? That's the
impression I get from reading the "Composition vs. Rendering" article at:
http://msdn.microsoft.com/library/de...srendering.asp
If so, does that mean that in the LoadPostData for, say, MyControl, you

could potentially read key/value pairs intended for other controls? Just
curious. Thank you for your time.
Nov 18 '05 #22

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

Similar topics

7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
6
by: Suzanne | last post by:
Hi all, I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
2
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
1
by: rizwanahmed24 | last post by:
Hello i have created a custom control. i have placed two template controls on it. One is check box and second is picture box. The custom control also contain two picture boxes as property. These...
2
by: Ron | last post by:
I would like some more information on custom controls, what they can do and things like that, what you would use them for etc... Can anyone here share some examples of what you have used a custom...
1
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.