[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

_ctl5:_ctl0:p1456 in webform textbox

Steve Steve

2/18/2004 4:15:00 PM

Hello

I've got a bit of a problem here!

Right, I manage my shopping basket on my shop website by just storing
the ids and quantities of the products the customer has added in the
Session - the textbox name that I use in product view to add a quantity
is a "P" and the itemid to pass to the next page - because there are
variants of the same product I have to create these rows in code but
when they submit they append "_ctl5:_ctl0:" to the beginning in the URL.
This isn't really a problem in itself as long as this remains the same
so when I come to request I can check for:
Request.QueryString["_ctl5:_ctl0:P4321"] for example to get at the
quantity value. 'P' followed by the id of '4321' so in the url I might
have expected &p4321=100 if a customer selected 100 quantity.

Right that explained - here is my problem - for the second time now this
"_ctl5:_ctl0:" has changed - this time to "_ctl4:_ctl0:" spontaneously
and it isn't the first time it's happened! That means that from a fully
functional basket all of a sudden I get server errors because the id
passed from textbox has changed.

My Question then is can this appendation be altered or bypassed
altogether so that this problem goes away?

Thanks
Steve


*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!
10 Answers

Steve Steve

2/19/2004 10:13:00 AM

0

I've managed to fix this on my application but not to my satisfaction -
it seems the field that is causing my problem is an HtmlInputHidden
which we set server side - I create the hidden like this in html

<input type="hidden" id="recno" name="recno" runat="server">

i.e. I set no value but runat=server so I can set it in code.

When the control is then created on the page the prefix is already there
- I assume it must be something to do with running it at server?

My solution is to store the prefix in the session when a control using
it is created (from base.UniqueId) and then the Session variable is
available when I need it. The problem with this is that I'm building a
site where the Session needs to be kept to a minimum to preserve RAM as
one of the requirements and I'm loathed to add more variables to it than
needed.

If anybody knows how to remove this prefix altogether when the control
is created could you please post and then I can get rid of the extra
Session var?

I have read about someone subclassing the radiobutton they were
including and overriding the UniqueId of the control they were creating
but I'm not sure where to start with this - any insight would be
appreciated.

Thanks
Steve


*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

Alessandro Zifiglio

2/19/2004 12:27:00 PM

0

hi steve, your controls are put in that namespace because they are child
controls. This is necessary to maintain unique ids through your page.

To remove the prefix you need to remove the control from within the
container(parent control) you placed it in.



"Steve Steve" <steswork@hotmail.com> wrote in message
news:%23VkoyDt9DHA.1596@TK2MSFTNGP10.phx.gbl...
> I've managed to fix this on my application but not to my satisfaction -
> it seems the field that is causing my problem is an HtmlInputHidden
> which we set server side - I create the hidden like this in html
>
> <input type="hidden" id="recno" name="recno" runat="server">
>
> i.e. I set no value but runat=server so I can set it in code.
>
> When the control is then created on the page the prefix is already there
> - I assume it must be something to do with running it at server?
>
> My solution is to store the prefix in the session when a control using
> it is created (from base.UniqueId) and then the Session variable is
> available when I need it. The problem with this is that I'm building a
> site where the Session needs to be kept to a minimum to preserve RAM as
> one of the requirements and I'm loathed to add more variables to it than
> needed.
>
> If anybody knows how to remove this prefix altogether when the control
> is created could you please post and then I can get rid of the extra
> Session var?
>
> I have read about someone subclassing the radiobutton they were
> including and overriding the UniqueId of the control they were creating
> but I'm not sure where to start with this - any insight would be
> appreciated.
>
> Thanks
> Steve
>
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


The Phantom Piper

7/27/2009 9:43:00 PM

0

On Jul 26, 9:56 pm, "Jeffrey Hamilton" <bberesf...@cogeco.ca> wrote:
>
> For the life of me, I cannot understand what *your*
> attraction is to this creep.

<raises hand> I can! I can understand it! Me, me - pick me!

> Now why is that?

'Birds of a feather'...


Happy To Help,

The Phantom Piper

The Phantom Piper

7/31/2009 10:25:00 AM

0

On Jul 30, 8:33 pm, Fred J. McCall <fjmcc...@gmail.com> wrote:
>
> Have you seen Deirdre's picture?  If I'm going to flock together
> with someone, there are far worse choices.  
>
> You, for instance...

Have you seen my picture? I think not! I'm hurt...


Coyly Cute,

The Phantom Piper

La N

7/31/2009 3:50:00 PM

0

The Phantom Piper wrote:
> On Jul 30, 8:33 pm, Fred J. McCall <fjmcc...@gmail.com> wrote:
>>
>> Have you seen Deirdre's picture? If I'm going to flock together
>> with someone, there are far worse choices.
>>
>> You, for instance...
>
> Have you seen my picture? I think not! I'm hurt...
>
>
> Coyly Cute,
>
> The Phantom Piper

Since physical appearances seem to be so important to (some) in this group,
why don't you and F*** post *your* photos ... ;p

- nilita " .... a thousand words and all that ..."


La N

7/31/2009 4:06:00 PM

0

La N wrote:
> The Phantom Piper wrote:
>
> Since physical appearances seem to be so important to (some) in this
> group, why don't you

btw, given that you, PP, are a sheeted man o' mystery, I thought that you
perhaps merited a grand tartan - a purple plaid ("PP") - and that's why I
posted this photo of you:

http://www.thesegments.com/images/SegmentsInT...

- nilita, who thinks she actually had a jumper made of that material once
upon a time ...


Fred J. McCall

7/31/2009 7:04:00 PM

0

"La N" <nilita2004NOSPAM@yahoo.com> wrote:

:The Phantom Piper wrote:
:> On Jul 30, 8:33 pm, Fred J. McCall <fjmcc...@gmail.com> wrote:
:>>
:>> Have you seen Deirdre's picture? If I'm going to flock together
:>> with someone, there are far worse choices.
:>>
:>> You, for instance...
:>
:> Have you seen my picture? I think not! I'm hurt...
:>
:
:Since physical appearances seem to be so important to (some) in this group,
:why don't you and F*** post *your* photos ... ;p
:

Why, Nilita, I didn't know you cared...

I don't care what I look like and certainly don't give a damn what
anyone else thinks. You, on the other hand, seem peculiarly coy while
being terribly concerned about your own and others' opinions of them.
And with all that coyness, you protect your 'secret' so poorly that
even I (who don't care) know what you look like.

In your case, you shouldn't be so concerned about your looks until you
fix your personality, which is sufficiently ugly to overwhelm mere
physicality.

--
You are
What you do
When it counts.

The Phantom Piper

7/31/2009 9:59:00 PM

0

On Jul 31, 8:49 am, "La N" <nilita2004NOS...@yahoo.com> wrote:
>
> why don't you and F*** post *your* photos ... ;p

There are no photographs of me.

(For some reason, they just come out as shadowy,
enigmatic forms half-hidden by dark, swirling mists...)


And Forget Mirrors As Well,

The Phantom Piper

The Phantom Piper

7/31/2009 10:14:00 PM

0

On Jul 31, 9:06 am, "La N" <nilita2004NOS...@yahoo.com> wrote:
>
> I posted this photo of you:
>
> http://www.thesegments.com/images/SegmentsInT...

I saw it the first time, but as it only resembles
a *part* of me, I didn't comment on it...

Oh, all right, if you absolutely need an Image, this one might do:

http://2.bp.blogspot.com/_UvgvuBakaew/SOBdfZ7arFI/AAAAAAAABic/sEi1VfKovJo/s1600-h/ScottishBagpiperHa...

(Although it's of a new member of the SPU, who was
only dead-dhrunk at the time the photo was snapped.)


Watch That First Step Off The Battlements Laddie...,

The Phantom Piper

La N

7/31/2009 11:20:00 PM

0

The Phantom Piper wrote:
> On Jul 31, 9:06 am, "La N" <nilita2004NOS...@yahoo.com> wrote:
>>
>> I posted this photo of you:
>>
>> http://www.thesegments.com/images/SegmentsInT...
>
> I saw it the first time, but as it only resembles
> a *part* of me, I didn't comment on it...
>
> Oh, all right, if you absolutely need an Image, this one might do:
>
> http://2.bp.blogspot.com/_UvgvuBakaew/SOBdfZ7arFI/AAAAAAAABic/sEi1VfKovJo/s1600-h/ScottishBagpiperHa...
>
> (Although it's of a new member of the SPU, who was
> only dead-dhrunk at the time the photo was snapped.)
>
>

And, actually, here's a candid shot of *you* in the same state:

http://farm1.static.flickr.com/11/15076535_6d8b69f9...

- nilita