Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Not hiting breakpoint in AddAttributesToRender() Method, what is missing here
posted

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[

 

DefaultProperty("Text"

)]

[

 

ToolboxData("<{0}:SNDTextBox runat=server></{0}:SNDTextBox>"

)]

 

 

public class SNDTextBox : WebTextEdit

{

 

 

 

public

SNDTextBox()

{

 

 

if (Roles

.Enabled)

{

 

 

if (Roles.IsUserInRole("View"

))

{

 

 

this.Enabled = false

;

}

}

}

 

[

 

Bindable(true

)]

[

 

Category(" Custom Properties"

)]

[

 

DefaultValue(false

)]

[

 

Localizable(true

)]

 

 

 

public bool

Mandatory

{

 

 

get

{

 

 

if (ViewState["Mandatory"] != null

)

{

 

 

bool s = (bool)ViewState["Mandatory"

];

 

 

return

s;

}

 

 

else

{

 

 

return false

;

}

}

 

 

set

{

ViewState[

 

"Mandatory"] = value

;

}

 

 

}

 

  

[System.Security.Permissions.

 

PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust"

)]

 

 

protected override void AddAttributesToRender(HtmlTextWriter

writer)

{

 

 

if

(Mandatory)

{

writer.AddAttribute(

 

"Mandatory", Mandatory.ToString(), true

);

}

 

 

base

.AddAttributesToRender(writer);