Click here to Skip to main content
15,920,801 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Html elements visibility (important) Pin
llp00na21-Jun-05 7:54
llp00na21-Jun-05 7:54 
QuestionHow to check if all the values of controls has been set in a html page? Pin
Anonymous19-Jun-05 23:17
Anonymous19-Jun-05 23:17 
AnswerRe: How to check if all the values of controls has been set in a html page? Pin
Vasudevan Deepak Kumar19-Jun-05 23:31
Vasudevan Deepak Kumar19-Jun-05 23:31 
Questioncan jsp use 2 servlets Pin
lhahehal19-Jun-05 21:42
lhahehal19-Jun-05 21:42 
AnswerRe: can jsp use 2 servlets Pin
Mattias Olgerfelt20-Jun-05 0:08
Mattias Olgerfelt20-Jun-05 0:08 
GeneralRegex problem Pin
alex.barylski17-Jun-05 13:01
alex.barylski17-Jun-05 13:01 
GeneralWeb Custom Control Designer issue Pin
work_to_live17-Jun-05 4:42
work_to_live17-Jun-05 4:42 
GeneralRe: Web Custom Control Designer issue Pin
minhpc_bk18-Jun-05 21:58
minhpc_bk18-Jun-05 21:58 
Hi there,
That is because the Table.Rows property is defined as an inner default property of the Table class and the value of the Rows property is persisted in design mode when the control is changed. So after the control has been changed, the control designer TableDesigner redraws the appearance of the table, the rows property is now updated with the added rows in the constructor and it results in the duplication as you are seeing. In this case, you need to create your own custom control designer, the sample code looks something like:
[Designer(typeof(CustomTableDesigner))]
public class WebNavigator : System.Web.UI.WebControls.Table
{
	public WebNavigator():base()
	{
	}
}
                    
public class CustomTableDesigner : System.Web.UI.Design.ControlDesigner 
{

	public override string GetDesignTimeHtml() 
	{
		WebNavigator table = (WebNavigator) Component;

		if (table.Rows.Count==0) 
		{
			TableRow row = new TableRow();
                                
			TableCell cell1 = new TableCell();
			HyperLink link1 = new HyperLink();
			link1.Text = "Home";
			link1.NavigateUrl = "Home.aspx";
			cell1.Controls.Add(link1);
			row.Cells.Add(cell1);
                             
			TableCell cell2 = new TableCell();
			HyperLink link2 = new HyperLink();
			link2.Text = "About Us";
			link2.NavigateUrl = "AboutUs.aspx";
			cell2.Controls.Add(link2);
			row.Cells.Add(cell2);
			            
			table.Rows.Add(row);
			               
			StringWriter sw = new StringWriter();
			HtmlTextWriter tw = new HtmlTextWriter(sw);
			table.RenderControl(tw);
			return sw.ToString();
		}
		else
			return base.GetDesignTimeHtml();
	}
}

GeneralRe: Web Custom Control Designer issue Pin
work_to_live20-Jun-05 5:08
work_to_live20-Jun-05 5:08 
GeneralRe: Web Custom Control Designer issue Pin
minhpc_bk20-Jun-05 6:30
minhpc_bk20-Jun-05 6:30 
GeneralInserting calendar in WebPage Pin
venugopal_112517-Jun-05 3:02
venugopal_112517-Jun-05 3:02 
GeneralRe: Inserting calendar in WebPage Pin
Vasudevan Deepak Kumar18-Jun-05 1:06
Vasudevan Deepak Kumar18-Jun-05 1:06 
Generaluploading file Pin
kh_neeru17-Jun-05 0:30
kh_neeru17-Jun-05 0:30 
GeneralRe: uploading file Pin
Vasudevan Deepak Kumar18-Jun-05 1:07
Vasudevan Deepak Kumar18-Jun-05 1:07 
GeneralProblem redesigning the CSS way Pin
David O'Neil15-Jun-05 21:53
professionalDavid O'Neil15-Jun-05 21:53 
GeneralRe: Problem redesigning the CSS way Pin
Mattias Olgerfelt20-Jun-05 0:20
Mattias Olgerfelt20-Jun-05 0:20 
GeneralRe: Problem redesigning the CSS way Pin
David O'Neil20-Jun-05 11:50
professionalDavid O'Neil20-Jun-05 11:50 
GeneralRe: Problem redesigning the CSS way Pin
DavidNohejl20-Jun-05 12:50
DavidNohejl20-Jun-05 12:50 
GeneralRe: Problem redesigning the CSS way Pin
Mattias Olgerfelt20-Jun-05 22:41
Mattias Olgerfelt20-Jun-05 22:41 
GeneralRe: Problem redesigning the CSS way Pin
David O'Neil21-Jun-05 4:59
professionalDavid O'Neil21-Jun-05 4:59 
GeneralRe: Problem redesigning the CSS way Pin
Mattias Olgerfelt21-Jun-05 5:42
Mattias Olgerfelt21-Jun-05 5:42 
GeneralRe: Problem redesigning the CSS way Pin
David O'Neil21-Jun-05 7:34
professionalDavid O'Neil21-Jun-05 7:34 
GeneralRe: Problem redesigning the CSS way Pin
Mattias Olgerfelt21-Jun-05 22:12
Mattias Olgerfelt21-Jun-05 22:12 
GeneralRe: Problem redesigning the CSS way Pin
Mattias Olgerfelt22-Jun-05 6:39
Mattias Olgerfelt22-Jun-05 6:39 
GeneralRe: Problem redesigning the CSS way Pin
David O'Neil22-Jun-05 7:42
professionalDavid O'Neil22-Jun-05 7:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.