Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > _ctl5:_ctl0:p1456 in webform textbox

Reply
Thread Tools

_ctl5:_ctl0:p1456 in webform textbox

 
 
Steve Steve
Guest
Posts: n/a
 
      02-18-2004
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:_ctl04321"] 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.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Steve Steve
Guest
Posts: n/a
 
      02-19-2004
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.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      02-19-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass value from activex textbox to webform textbox AGSHAR ASP .Net 1 05-31-2008 12:00 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM
runat="server"....a simple html textbox or a webform server textbox...that is the question. Hazzard ASP .Net 2 07-23-2003 07:32 AM
Re: runat="server"....a simple html textbox or a webform server textbox...that is the question. Natty Gur ASP .Net 0 07-22-2003 03:57 AM



Advertisments