|
-
Mar 25th, 2008, 02:25 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] Access objects in 3rd party Tab Control tags
Okay, before I really confuse anyone I have switched to Visual Web Developer 2005 EE.
I am using a free Tab Control from asplib.net and have the tabs within <ConentTemplate> tags, part of the control. I also have the option to insert them as separate pages which I have done for a different tabbed page and it works fine. I don't want to do it for this page though because it would involve creating a seperate page for each tab, and I have a save button outside of the tabs that works for all tabs regardless of whether the page being saved is new or is being updated. Having it on the page and having the contents it's saving on separate pages would involve making a new method on each tabs page and calling them, but any time I have tried calling methods on different pages I have ended up having to give up and find another way.
The problem is that the back end code does not recognize any objects referenced that are within the tab tags. I believe there is a way to to have them recognized by adding a line at the top of the class (an inherits statement perhaps?) but I am not sure. Does anyone have any suggestions/ideas?
-
Mar 26th, 2008, 07:36 AM
#2
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
I got a response from asplib.net support and they said "Use control's client side event. Or you need use other clent side way".
Would this work? How would I do it?
-
Mar 26th, 2008, 08:58 AM
#3
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
-
Mar 26th, 2008, 09:51 AM
#4
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
I read an article that said to try changing the default focus for nested controls but it was meant for a single control. I tried it anyway, adding "DefaultFocus="Tabs$General" but it didn't work. Tabs is the ID of the TabControl and General is the ID of the first Tab. I also tried variations (putting form ID first, trying one specific control instead of all within General tab, etc.) Can anyone tell me what I'm doing wrong or why this won't work?
-
Mar 26th, 2008, 11:15 AM
#5
Re: [2005] Access objects in 3rd party Tab Control tags
Show your markup (ASPX), all of it so that we can see the third party control and the page directive at the top of the page. Don't forget to use [code] tags.
-
Mar 26th, 2008, 11:21 AM
#6
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
I've attached the whole file, it was too long to post.
Last edited by Rikki_UW; Oct 30th, 2008 at 07:55 AM.
-
Mar 26th, 2008, 02:18 PM
#7
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
I have considered using findcontrol at the beginning of the class, but it would mean about 25 findcontrols. Bad enough for this page but another page that will have the same setup has 60+ controls to find.
-
Mar 27th, 2008, 09:10 AM
#8
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
I tried putting "Dim lblID As Label = FindControl("lblID")" for all necessary controls before page_load. I couldn't put e.item.findcontrol in page_load because the 'item' part doesn't exist. I stop getting errors about the objects not existing put now I get "object reference not set to an instance of an object" at runtime.
Mendhak, are you making any progress?
UPDATE: I had to put a withevents clause for all buttons because i was getting an error, and that replaced the need to use FindControl for the buttons and avoids compile-time errors, but i don't know about runtime errors yet. i tried using a withevents clause instead of FindControl for lblID (the first control accessed at page_load) but it didn't work any better.
MSDN gives this code to declare a DataGridCommandEventArgs:
Code:
Dim instance As DataGridCommandEventArgs
Dim value As Object
value = instance.CommandSource
But I get "object reference not set to an instance of an object" for the last line, is it possible to correct this so that I can use value.item.FindControl in the page_load method?
Last edited by Rikki_UW; Mar 27th, 2008 at 09:33 AM.
-
Mar 27th, 2008, 09:49 AM
#9
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
On second thought I just realized declaring a DataGridCommandEventArgs isn't possible. My bad.
-
Mar 27th, 2008, 02:37 PM
#10
Re: [2005] Access objects in 3rd party Tab Control tags
This control does not seem to be properly documented. I tried going through their documentation
http://docs.asplib.net/asplib/TabControl.html
But it's all talking about client side code. I am not sure how it can be accessed in the codebehind especially since it's not a regular ASP.NET control. It seems to be AJAX.
My initial guess would be to go through Tabs.Controls, or Tabs.FindControl, or perhaps the TabPanels have been enumerated which would be in Tabs.TabPanels or Tabs.Panels, which in turn would have a control collection or findcontrol method.
-
Mar 31st, 2008, 11:56 AM
#11
Thread Starter
Addicted Member
Re: [2005] Access objects in 3rd party Tab Control tags
Thanks for the help but I ended up splitting up the page. I now need to figure out how to call the save method from another page, but I posted that as a separate thread.
--Rikki
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|