I add a control in code behind:
HtmlTableCell cell = new HtmlTableCell();
DNNTextSuggest textSuggest = new DNNTextSuggest();
textSuggest.ID = textPrefix + question.id;
cell.Controls.Add( textSuggest );
|
But i have a problem when i bulid website and check the output
In Admin / Edit mode
<input name="dnn$ctr450$ViewRegister$TEXT_4" type="text" maxlength="100"
id="dnn_ctr450_ViewRegister_TEXT_4" class="formbox_default" questionid="4" sysimgpath="images/"
tscss="SuggestTextMenu GroupSuggestMenu" csshover="SuggestNodeOver" del=" "
postback="__doPostBack('dnn$ctr450$ViewRegister$TEXT_4','[TEXT]Click')"
callback="dnn.xmlhttp.doCallBack('TEXT_4 dnn_ctr450_ViewRegister_TEXT_4',this.getText(),this.callBackSuccess,this,this.callBackFail,this.callBackStatus,null,null,0);" /> |
But in view mode
<input name="dnn$ctr450$ViewRegister$ViewRegister$TEXT_4" type="text" maxlength="100"
id="dnn_ctr450_ViewRegister_ViewRegister_TEXT_4" class="formbox_default" questionid="4" sysimgpath="images/"
tscss="SuggestTextMenu GroupSuggestMenu" csshover="SuggestNodeOver" del=" "
postback="__doPostBack('dnn$ctr450$ViewRegister$ViewRegister$TEXT_4','[TEXT]Click')"
callback="dnn.xmlhttp.doCallBack('TEXT_4 dnn_ctr450_ViewRegister_ViewRegister_TEXT_4',this.getText(),this.callBackSuccess,this,this.callBackFail,this.callBackStatus,null,null,0);" /> |
I want to know why the control ID is different? And how can i aviod it?
Thanks!