• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

Asp.net Control ID (ClientIDMode) question / interaction with Obout Control failing

I am getting mixed results on different servers from the same code.

I have an obout textbox and an obout calendar that extends the textbox, based on its ID.  They live inside a control.

The name of the text box is, for simplicity:  Start_Date
The obout calendar asks for TextBoxID, so I enter Start_Date.

If i have this code outside of the control, in the main page, it works fine on both servers... but if I have it in the control and it isn't pushing dates to the text field at all... field remains blank.

One thing I found interesting was that if i set the TextBoxID in the calendar to ControlName1$Start_Date, it functions fine on one server, but not the other.

In investigating the output code, i see something interesting...

one server renders the text box's id as:

and the other server as:

I don't see why, but this seems to be causing some issue with the calendar to actually push the clicked date value into the text box.

I tried playing around with ClientIDMode.  Tried all the different settings (Static, etc).  Same results every time.

Any ideas as to what I could be missing here?  Why does one use an underscore, and one use a dollar sign in the ID naming, and is there any way to make this "predictable" (as predictable in clientIDMode didn't seem to affect this)

And any idea why i can't just use the actual text box's ID name "Start_Date" when setting TextBoxId="Start_Date" in the obout calendar?

Thanks for suggestions or tips.  I've spent so much time going in circles on this one.
Robert Hamel
Robert Hamel
  • 6
1 Solution
Robert HamelSenior .NET developerAuthor Commented:
here is the code used in the Control:



Open in new window

here is the actual post render source code on one server:
class="ob_iTIE" />

Open in new window

and the other:
class="ob_iTIE" />

Open in new window

If you post a link to the page we can see what is happening on the page and that will increase the probability of finding a solution.

Robert HamelSenior .NET developerAuthor Commented:
it was behind a login screen, but I've made a copy of it...

Here is a link to a trimmed down version of the page that has the code on it rendering with $ in control id name:

and here is the same page, on a different server, rendering the control id with an underscore instead.

 Click the link for 'Show Scheduled Course Filter'
The date pickers in that control are not working.

But the date pickers in the main page, Promo start and end, work just fine.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Robert HamelSenior .NET developerAuthor Commented:
One more tidbit that may or may not provide any value.

both these servers above are windows 2003 server.

I've also tested on windows 2008 and it seems to work similarly to the first example, using the $ as the separator.
Robert HamelSenior .NET developerAuthor Commented:

I've been messing with things trying to figure it out.

I've gotten it back to where the date selector works in one, but not the other.
my obout calendar is targeting ClassFilter1$cfTextBoxStartDateFilter now, which works on the first site but not 2nd.
This is because IIS is translating the name to ClassFilters1_cfTextBoxStartDateFilter on the 2nd server.

if i just enter cfTextBoxStartDateFilter, both site's class filter control calendars break, which is what you were seeing.

But using ClassFilter1$ in the target control's ID in a .net object just seems counter intuitive.  It should automatically figure it out, but it isn't.

I really think its going to come down to figuring out what causes the _ vs the $ in the ID tag of the text box in the rendering so I can set the server to respond properly.
Robert HamelSenior .NET developerAuthor Commented:
I've went ahead and restyled a common asp textbox to have same look as the obout control and that satisfied my requirements.  Can't waste any more time on figuring out the quirk.

Thanks for looking.
Robert HamelSenior .NET developerAuthor Commented:
Not happy with my own solution, but just didn't find any better way
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now