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

Simple question: Retrieve form elements name in content placeholder

Hi,

If I have a TextBox place inside a content placeholder then at runtime the
TextBox's name changes to ctl00_ContentPlaceHolder1_tbCity. What is the best
way to get the value of the TextBox server-side without 'guessing' the name
in the produced HTML?
Page.Request("??")

Thanks
--
Kees de Winter
May 12 '06 #1
3 1972
Reques.Form(myTextBox.UniqueId)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kees de Winter" <nospam> wrote in message
news:44**********************@text.nova.planet.nl. ..
Hi,

If I have a TextBox place inside a content placeholder then at runtime the
TextBox's name changes to ctl00_ContentPlaceHolder1_tbCity. What is the
best
way to get the value of the TextBox server-side without 'guessing' the
name
in the produced HTML?
Page.Request("??")

Thanks
--
Kees de Winter

May 12 '06 #2
Thanks Karl,

Thank you for the quick answer.
One more question: if the form is posted to another page, then the variable
myTextBox will be unknown. How to retrieve a Form elements value then?

Thanks
--
Kees de Winter
"Karl Seguin [MVP]"
Reques.Form(myTextBox.UniqueId)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kees de Winter" wrote in message
news:44**********************@text.nova.planet.nl. ..
Hi,

If I have a TextBox place inside a content placeholder then at runtime the TextBox's name changes to ctl00_ContentPlaceHolder1_tbCity. What is the
best
way to get the value of the TextBox server-side without 'guessing' the
name
in the produced HTML?
Page.Request("??")

Thanks
--
Kees de Winter


May 12 '06 #3
u don't :)

2.0 supports crostpass postback.

The only solution I can think of to get out of your mess is
(a) don't use server controls
(b) do some crazy javascript stuff to either change the names or copy values
into hidden form fields that you do know the name...this solution sucks :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kees de Winter" <nospam> wrote in message
news:44**********************@text.nova.planet.nl. ..
Thanks Karl,

Thank you for the quick answer.
One more question: if the form is posted to another page, then the
variable
myTextBox will be unknown. How to retrieve a Form elements value then?

Thanks
--
Kees de Winter
"Karl Seguin [MVP]"
Reques.Form(myTextBox.UniqueId)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kees de Winter" wrote in message
news:44**********************@text.nova.planet.nl. ..
> Hi,
>
> If I have a TextBox place inside a content placeholder then at runtime the > TextBox's name changes to ctl00_ContentPlaceHolder1_tbCity. What is the
> best
> way to get the value of the TextBox server-side without 'guessing' the
> name
> in the produced HTML?
> Page.Request("??")
>
> Thanks
> --
> Kees de Winter
>
>



May 12 '06 #4

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

Similar topics

6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
9
by: beguigne | last post by:
Below is a snippet of a crude date picking routine for a form. I am a novice at this so, I am hitting my head at why when I select the day, the onChange event gives me a blank. What am I missing?...
1
by: jm | last post by:
Easy probably, please read on. I know some of you have commented already about some of my socket question. I appreciate that. I have a Form1: static void Main() { Application.Run(new...
6
by: wASP | last post by:
Hello everyone, I'm new to C# and ASP.NET, so pardon my stupidity on this one. I'm having a problem with referencing methods/functions external to a class member function. My code is as...
2
by: leila | last post by:
I am developing an ASP.Net application for a client and they need to modify the page layout from within a form. like the way you edit a blog template in Blogger. what is the best approach to do...
12
by: TheOne | last post by:
In Asp.net web form under form tag there is action field that I am point to some other page, and not to same web form. When I run this page it is always pointing to itself. How do I get around...
29
by: Knut Olsen-Solberg | last post by:
I try to change the text in a <p> using getElementById(). I wonder what properties exists, and which one to use here. (The following does not work.) Regards Knut ______________________ ...
2
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. ...
2
by: Bob | last post by:
I am trying to obtain values of a submitted form when the form is inside a content placeholder via a master page. For example: <asp:content contentplaceholderid="contentMain" runat="server">...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.