ASP.NET TextBox - is it possible to initialize text attribute with in line code <% %>

前端 未结 5 918
傲寒
傲寒 2021-01-18 12:51


I need to initialize the text attribute of the text box element with a property from some where else when actually I can simply do this from code but it will be much m

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 13:40

    You can set the text on a page in a similar way.

    ' />
    

    But in order for this to work, you will need to DataBind the control on Page_Load. For multiple TextBox controls you could just loop through each and databind them so that you do not have to hard code the databinding of each.

    I am not sure what your ContextItem is though, so you would have to modify my code.

提交回复
热议问题