Magiaus
Mar 31st, 2004, 06:26 AM
Since reading the thread about REsponse.Write I've been wondering about something I do from time to time and what the .net view of it would be.
What I do is I make 4 or 5 UserControls lets say new.ascx, edit.ascx, delete.ascx, view.ascx and action_results.ascx. I also have an asp.net page called default.aspx in the app dir for this app. Now default.aspx has a select/switch statement that reads the QueryString for takeAction and display the correct ascx based on action. The only way I know to do this is by using:
<%
switch(Request["takeAction"])
{
case "action": %><asp_uctls:ctl...../><% break;
case "....":.....
}
%>
So is that good, bad, is there a better way, will asp.net read the tag properly if I Response.Write it from the CodeBehind Class, or is all this just nitpicky?
What I do is I make 4 or 5 UserControls lets say new.ascx, edit.ascx, delete.ascx, view.ascx and action_results.ascx. I also have an asp.net page called default.aspx in the app dir for this app. Now default.aspx has a select/switch statement that reads the QueryString for takeAction and display the correct ascx based on action. The only way I know to do this is by using:
<%
switch(Request["takeAction"])
{
case "action": %><asp_uctls:ctl...../><% break;
case "....":.....
}
%>
So is that good, bad, is there a better way, will asp.net read the tag properly if I Response.Write it from the CodeBehind Class, or is all this just nitpicky?