I have created a Web User Control (.ascx). I can drag that on the page. Now,
i wanted to know few things:
1. When i drag-drop the validator control on the page, in the
controltovalidate property i cannot see the name of my custom control
(.ascx). what could be the reason ??
2. I want that the java script that is attached in the custom control must
be posted only once when i say view source from IE.
How do i achieve the above two features ??
thanks in advance,
sat.
For question 2, call the RegisterClientScriptBlock method of the page class
to make sure that a script with the same key is written out only once.
"SatinderGT" <sati...@thegt.com> wrote in message
news:OmZ2Ryy3...@TK2MSFTNGP10.phx.gbl...
As for the original question, you can probably use this technique to
"validate" the user control.
--
Saverio Mercurio
mailto:Saverio.M**erc...@atNOgroupSPAMinc.com
NOTE: My email address has been purposefully altered to thwart mailing list
harvesters.
"Marina" <zlat...@nospam.hotmail.com> wrote in message
news:eN8QYCz3...@TK2MSFTNGP11.phx.gbl...
"Saverio Mercurio" <Saverio.M**erc...@atNOgroupSPAMinc.com> wrote in
message news:uHhpNC03...@TK2MSFTNGP09.phx.gbl...
<url>
ms-
help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebUIValidationPropertyAtt
ributeClassTopic.htm
</url>
This article describes the ValidationPropertyAttribute attribute with
which you indicate which property on the user control should be used for
validation. According to the help, the validators will use this property
as their required field, comparison field, or whatever:
[ValidationPropertyAttribute("CustomProperty")]
public abstract class UserControl1: System.Web.UI.UserControl
{
private string m_Value = String.Empty;
public string MyProperty
{
get { return m_Value; }
set { m_Value = value; }
}
}
HTH!
Chris
"Marina" <zlat...@nospam.hotmail.com> wrote in
news:e$umW023C...@TK2MSFTNGP09.phx.gbl:
Thanks a ton.
Does any one has example on the javascript question. That is if there
are 2 instances of the control on one .aspx, how can i have the java
script for only once.
thanks in advance,
sat.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Here's a few interesting articles from MSDN
<url>
http://search.microsoft.com/gomsuri.asp?n=1&c=rp_Results&siteid=us/dev&ta
rget=http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIP
ageClassRegisterClientScriptBlockTopic.asp </url>
<url>
http://search.microsoft.com/gomsuri.asp?n=3&c=rp_Results&siteid=us/dev&ta
rget=http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIP
ageClassIsClientScriptBlockRegisteredTopic.asp </url>
HTH!
Chris
Satinderpal Singh <sati...@thegt.com> wrote in
news:eAwLlpW4...@TK2MSFTNGP10.phx.gbl: