Superfluous labels

  • Thread starter Thread starter newsgroupie
  • Start date Start date
N

newsgroupie

Hi Newsgroupies,

Is there any way to prevent superfluous label members being
automatically added to a Webforms code-behind file? For example...

protected System.Web.UI.WebControls.Label Label19;

....where 'Label19' is just a 'decoration' text field on the webform.

Many thanks,

Newsgroupie, UK
 
If there is no need to have it run at server, then you could use just a
html:label.
<label>decoration</label>
instead of
<asp:Label id="Label19" runat="Server">decoration</asp:Label>

If there is a reason for running the label at server, well, i get around by
not going via Design View of ASPX file back to codebehind file, but rather
directly from the HTML view.
If you are in Design View, i guess you could right-click and say "View Code"
instead of double-clicking the form.
Or, you could just delete that one-line statement in a blink.
 
Hi Newsgroupie!!!!!!
From the toolbox , select the HTML tab it will open the list of html
control . Add an html lable that is not added to the code behind simply
because it doesn't belong to System.Web.UI.WebControls as an asp control .
one other thing you can do , is to edit the html of the page your self to
add the text your self. But this is more convenience if you use the flow
layout for the page (the default is the grid layout , still you can do it )
Hope this clears it

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top