Groups | Blog | Home
all groups > asp.net webcontrols > november 2004 >

asp.net webcontrols : Attribute is not setting


Michael Tkachev
11/26/2004 6:17:20 PM
Please send your code.

[quoted text, click to view]

Thiruppathi S
11/26/2004 6:27:49 PM

Hi All,

I had created a server control inheriting RequiredFiledValidator Class
to add my custom attributes.But the controltovalidate attribute is not
rendering.

Plz help me.


Regards,

S.Thiruppathi


Thiruppathi S
11/26/2004 8:29:47 PM
HI Micheal,

here's my code.I just override the Addattributes to Render
method.BUt the ControlToValidate attribute is not setting.while
debugging i got the value but itz not rendering

Could u plz help me

<ToolboxData("<{0}:iRequiredFieldValidator
runat=server></{0}:iRequiredFieldValidator>")> _
Public Class iRequiredFieldValidator
Inherits System.Web.UI.WebControls.RequiredFieldValidator
Implements INamingContainer

private pri_bolSetFocusOnError as booleam=True

'-----------------------------------------------------------------------
---------
' <summary>
' Set Focus to Error Control
' Default is "True".
' </summary>
<DefaultValue(True), _
Category("Behavior"), _
Description("Set Focus to Error Control.")> _
Public Property SetFocusOnError() As Boolean
Get
Return pri_bolSetFocusOnError
End Get
Set(ByVal Value As Boolean)
pri_bolSetFocusOnError = Value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal writer As
System.Web.UI.HtmlTextWriter)
MyBase.AddAttributesToRender(writer)
If MyBase.RenderUplevel Then
If SetFocusOnError = True Then
writer.AddAttribute("focusOnError", "true")
End If
End If
End Sub

End Class

*** Sent via Developersdex http://www.developersdex.com ***
Thiruppathi S
12/7/2004 1:16:13 PM
Hi All,

I found out this, itx due to implementing INaming Container

[quoted text, click to view]

AddThis Social Bookmark Button