//AreaId隐藏域
writer.AddAttribute(HtmlTextWriterAttribute.Name, "AreaId");
writer.AddAttribute(HtmlTextWriterAttribute.Id, "AreaId");
writer.AddAttribute(HtmlTextWriterAttribute.Value, string.IsNullOrEmpty(this.Id) ? this.ParentId : this.Id);
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
这段输出结果:<input name="AreaId" id="AreaId" value="f5deb16f-df87-421e-acc6-515bde3a6f8d" />
我想给它加个属性type="hidden"怎么修改上面的C#代码?谢谢。
------解决方案--------------------------------------------------------
writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");