Last post Oct 21, 2010 03:16 AM by dk_4_asp
Mar 28, 2007 10:05 AM|dministrator|LINK
Whenever I add a CheckboxList control to my page in design view, I'm not seeing the corresponding protected variable that the form designer automatically adds in the .cs file.
Also, I can't find the OnInit method and InitializeComponent methods in my .cs file. I don't think I deleted them. How to restore this page in proper order ? How could have they disappeared?
I'm using the AJAX Extensions/ .Net 2.0 / VS 2005 / developing on XP Professional / IIS on a Windows 2000
Mar 28, 2007 10:22 AM|ecbruck|LINK
If you're using 2.0, you won't see these control declarations any more. These declarations along with your event declartaions are now placed into an automatically generated partial class which are combined together when compiled. Therefore, you should still
be able to reference this CheckBoxList control from your code-behind page, but you simply won't see the control declaration. Here's an article that may shed some light for you:
Mar 28, 2007 10:25 AM|LSU.Net|LINK
Mar 28, 2007 10:52 AM|dministrator|LINK
Thanks to both for responding. Thanks for that link. I'm new to 2.0 as you can tell.
I forgot to add this to my original question:
Whenever I double click the SelectedIndexChanged event in the properties for this CheckBoxList, the call gets added to the control in the .aspx file but for some reason, it is not creating that empty event handler method in the
.cs part of it. Why is this ? Please forgive me if I'm missing the obvious.
Mar 28, 2007 10:59 AM|ecbruck|LINK
Mar 28, 2007 11:01 AM|LSU.Net|LINK
You are using code behind as you have mentioned previously, but still check the markup portion of it to see if it wasn't created in a <script runat="server"> block.
Mar 28, 2007 11:14 AM|dministrator|LINK
It's not just the checkboxlist; none of the event handling methods for a gridview are created automatically, when I double click. Could it be because of the AJAX extensions? I'm using the ScriptManager and UpdatePanel from the AJAX Extensions and my Checkbox
list is outside these two elements and the gridview is within the UpdatePanel.
I really do thank you for your time and patience.
Oct 19, 2010 02:27 AM|Nayyarmas|LINK
I am having the same problem, Any one please ?
Oct 21, 2010 02:24 AM|Nayyarmas|LINK
I have solved the problem by creating a new page and copying the stuff from the old page, but I am sure there must be an easier way to that.
The problem is whenever i double click any asp control instead of opening an event handler in CS file it opens it in aspx under tag <script> plus all the controls in cs file show error, clearly meaning that both files are out of Sync, Can any one tell how
to get them in Sync again ?
Thanks in advance
aspx cs sync
Oct 21, 2010 02:29 AM|riswadkarharshad|LINK
Is it happening for all the pages in your application or only for a single page. If its happening only for a single page, you can take backup of the page/code, delete the page and recreate and see if the newly created page works fine.
Oct 21, 2010 02:36 AM|Nayyarmas|LINK
Thanks for the quick reply this was happening with a single page, I already did exactly what u said and the problem was
I was asking this just out of curiosity that is there a better solution to this ?
Oct 21, 2010 02:57 AM|dk_4_asp|LINK
Just check whether your aspx and .cs page are under same namespace..............I guess they might b different coz I had experienced this prob b4 and came to knw abt this.......
MArk as answer if it helps you.
Oct 21, 2010 03:06 AM|Nayyarmas|LINK
understood, just one more small thing !
How do i "Mark as Answer" ?
Oct 21, 2010 03:16 AM|dk_4_asp|LINK
well you cannot do that thing........only "dministrator" can do this coz he started this thread.