Hi Marc,
Thanks for your reply.
Yes, for the separator of the ID and ClientID, it is not recommend to
directly use a hardcode characte since it may change from version from
version(event different from different control adapters in asp.net). If
you do need to get this separator, there are two properties on the Page
class(also derived and override from Control class), they're "IdSeparator"
and "ClientIDSeparator", one of them is "protected", you may define a
custom utility class(dervied from page class) and expose these properties.
e.g.
public class PageUtil : Page
{
public string GetIdSeparator()
{
return this.IdSeparator.ToString();
}
public string GetClientIDSeparator()
{
return this.ClientIDSeparator.ToString();
}
}
Then, you can use it in your page code. e.g.
protected void Page_Load(object sender, EventArgs e)
{
PageUtil util = new PageUtil();
Response.Write("<br/>IdSeparator: " + util.GetIdSeparator());
Response.Write("<br/>ClientIdSeparator: " +
util.GetClientIDSeparator());
}
BTW, if you're usnig the "ClientID" Property, this value will help
automatically do the name mangling so that you can use it direclty in
client script.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] - 19 Feb 2007 14:23 GMT
Hello Marc,
Have you got any further ideas or progress on this issue? if there is
anything else we can help, please feel free to let me know.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
MarcG - 21 Feb 2007 19:52 GMT
Sorry Steven, I got lost for a bit and neglected to set the "Notify Me of
Replies" box.
That response was perfect. Thanks. A case of RTFM, I'm afraid, but so much
to read, so little time...
Thx
Marc
Steven Cheng[MSFT] - 22 Feb 2007 01:49 GMT
Thanks for your followup.
I'm glad that those suggestions help you.
Have a good day!
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead