كيفية التغيير برمجيا نص تمتد داخل قالب التقدم في C #؟
-
21-12-2019 - |
سؤال
لدي UpdateProgress التالي:
giveacodicetagpre.أحتاج إلى التغيير في التعليمات البرمجية خلف النص "aguarde ..." التي قمت بتأليفها داخل فترة "Saguarde"، لكنني لا أعرف كيفية الوصول إلى هذه الفترة.اللغة C #.
شكرا جزيلا للمساعدة.
المحلول
فقط قم بتغيير عنصر تحكم <span>
مع التسمية كما يلي -
والوصول إليها من CodeBehind كما يلي -
giveacodicetagpre.نصائح أخرى
You could change the span to a serverside control:
<span id="sAguarde" runat="server">Aguarde ...</span>
Then you can access it from the codebehind:
protected override void Render(HtmlTextWriter writer)
{
if (update) // globally declared update boolean to check if the page is being updated
{
HtmlGenericControl sAguarde = (HtmlGenericControl) UpdateProgress1.FindControl("sAguarde");
sAguarde.InnerHTML = "Hi";
}
base.Render(writer);
}
But note that the span's id will be rendered using ASP.NET control naming conventions.
For full context, see: Changing the contents of the UpdateProgress control
لا تنتمي إلى StackOverflow