Ask a Question related to ASP.NET General, Design and Development.
-
Boban Dragojlovic #1
automatic insertion of controls on codebehind
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX)
Later, I switch to codeview, and I notice that some (sometimes all) of the controls I created have been automatically defined for me in the
#Region " Web Form Designer Generated Code "
section
Later, when I add more controls this no longer happens.
First, I'm wondering which of my actions causes it to no longer do this;
and
is there a command I can issue to force it to "review" the ASPX page and re-synchronize the codebehind form?
Boban Dragojlovic Guest
-
Ad Insertion
Hi folks, this is a pre-sales question really but everything seemed to point me to here... The feature spec for FMS mentions that it can perform... -
automatic insertion of title atribute taken from links and or images extension
Is there any extension like that? automatic insertion of title atribute taken from links and or images. -
XML Bullet insertion
Hello, I wish to insert a bullet before the string of text. HOw to I achieve this? Thanks in advance. <textData textId="callout15"> <!]>... -
User Controls and CodeBehind
Hi, It may sound stupid, but this happens when you forget to compile the .cs files first. If this is not the problem and the compile went ok,... -
Refrencing user controls in codebehind
Hi Rory, You will need to call LoadControl everytime no matter which value IsPostBack is set to. From your post it seems like you're calling it... -
Boban Dragojlovic #2
Re: automatic insertion of controls on codebehind
Actually, I type all my controls in HTML View because I don't like to work with the form designer. Yet in spite of that, VS often manages to "see" them and place them into the codebehind.
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message news:OQ9BI3WUDHA.1624@TK2MSFTNGP11.phx.gbl...
If you drag the control from the toolbox then it should always put the declaration in the code behind for you, assuming such an action is valid for that control. For instance, if you drag an HTML control instead of a webform and you don't mark it as a server control then the definition will not be in the code behind because it's not valid to be there.
Also, if you type in the control definition into the HTML view of your page (instead of dragging it from the toolbar onto the designer view of your form) then I wouldn't expect VS.NET to automatically put the definition into the code behind for you.
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message news:g6ETa.47$uP7.7666802@newssvr14.news.prodigy.c om...
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX)
Later, I switch to codeview, and I notice that some (sometimes all) of the controls I created have been automatically defined for me in the
#Region " Web Form Designer Generated Code "
section
Later, when I add more controls this no longer happens.
First, I'm wondering which of my actions causes it to no longer do this;
and
is there a command I can issue to force it to "review" the ASPX page and re-synchronize the codebehind form?
Boban Dragojlovic Guest
-
S. Justin Gengo #3
Re: automatic insertion of controls on codebehind
Boban,
I've noticed similar happenings. I have an untested theory. Could you sometimes be switching directly from the html view to the codebehind? And other times switching from the html view to the design view and THEN to the codebehind?
My theory is that if you switch from html view to design view the page gets processed and your objects are added to the codebehind.
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message news:4BETa.51$sg.9096303@newssvr14.news.prodigy.co m...
Actually, I type all my controls in HTML View because I don't like to work with the form designer. Yet in spite of that, VS often manages to "see" them and place them into the codebehind.
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message news:OQ9BI3WUDHA.1624@TK2MSFTNGP11.phx.gbl...
If you drag the control from the toolbox then it should always put the declaration in the code behind for you, assuming such an action is valid for that control. For instance, if you drag an HTML control instead of a webform and you don't mark it as a server control then the definition will not be in the code behind because it's not valid to be there.
Also, if you type in the control definition into the HTML view of your page (instead of dragging it from the toolbar onto the designer view of your form) then I wouldn't expect VS.NET to automatically put the definition into the code behind for you.
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message news:g6ETa.47$uP7.7666802@newssvr14.news.prodigy.c om...
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX)
Later, I switch to codeview, and I notice that some (sometimes all) of the controls I created have been automatically defined for me in the
#Region " Web Form Designer Generated Code "
section
Later, when I add more controls this no longer happens.
First, I'm wondering which of my actions causes it to no longer do this;
and
is there a command I can issue to force it to "review" the ASPX page and re-synchronize the codebehind form?
S. Justin Gengo Guest
-
news.public.microsoft.com #4
Re: automatic insertion of controls on codebehind
I would agree with this theory as the HTML code gets "tidied up" when
switching to design and back to HTML (tables and other elements get
indented, etc).
"S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
news:%230N2nYYUDHA.2364@TK2MSFTNGP09.phx.gbl...
Boban,
I've noticed similar happenings. I have an untested theory. Could you
sometimes be switching directly from the html view to the codebehind? And
other times switching from the html view to the design view and THEN to the
codebehind?
My theory is that if you switch from html view to design view the page gets
processed and your objects are added to the codebehind.
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
news:4BETa.51$sg.9096303@newssvr14.news.prodigy.co m...
Actually, I type all my controls in HTML View because I don't like to work
with the form designer. Yet in spite of that, VS often manages to "see"
them and place them into the codebehind.
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
news:OQ9BI3WUDHA.1624@TK2MSFTNGP11.phx.gbl...
If you drag the control from the toolbox then it should always put the
declaration in the code behind for you, assuming such an action is valid for
that control. For instance, if you drag an HTML control instead of a
webform and you don't mark it as a server control then the definition will
not be in the code behind because it's not valid to be there.
Also, if you type in the control definition into the HTML view of your page
(instead of dragging it from the toolbar onto the designer view of your
form) then I wouldn't expect VS.NET to automatically put the definition into
the code behind for you.
news.public.microsoft.com Guest
-
Boban Dragojlovic #5
Re: automatic insertion of controls on codebehind
Interesting. You may have hit it on the head.
I just added a control in HTML view (as I always do). I then switched to Design view, and back to HTML view. Then I switched back to codeview, and voila - there it was.
Aaaaahhhhh. What a delight. It is SUCH a pain having to manually define them all in codeview.
Thanks, Justin
"S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message news:%230N2nYYUDHA.2364@TK2MSFTNGP09.phx.gbl...
Boban,
I've noticed similar happenings. I have an untested theory. Could you sometimes be switching directly from the html view to the codebehind? And other times switching from the html view to the design view and THEN to the codebehind?
My theory is that if you switch from html view to design view the page gets processed and your objects are added to the codebehind.
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message news:4BETa.51$sg.9096303@newssvr14.news.prodigy.co m...
Actually, I type all my controls in HTML View because I don't like to work with the form designer. Yet in spite of that, VS often manages to "see" them and place them into the codebehind.
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message news:OQ9BI3WUDHA.1624@TK2MSFTNGP11.phx.gbl...
If you drag the control from the toolbox then it should always put the declaration in the code behind for you, assuming such an action is valid for that control. For instance, if you drag an HTML control instead of a webform and you don't mark it as a server control then the definition will not be in the code behind because it's not valid to be there.
Also, if you type in the control definition into the HTML view of your page (instead of dragging it from the toolbar onto the designer view of your form) then I wouldn't expect VS.NET to automatically put the definition into the code behind for you.
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message news:g6ETa.47$uP7.7666802@newssvr14.news.prodigy.c om...
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX)
Later, I switch to codeview, and I notice that some (sometimes all) of the controls I created have been automatically defined for me in the
#Region " Web Form Designer Generated Code "
section
Later, when I add more controls this no longer happens.
First, I'm wondering which of my actions causes it to no longer do this;
and
is there a command I can issue to force it to "review" the ASPX page and re-synchronize the codebehind form?
Boban Dragojlovic Guest



Reply With Quote

