Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 24 Sep 2007 10:23 GMT
Hello,

I have a page with 2 web controls. WC2 is inside WC1 as follows:

Page

  |---- WC1

     |------ WC2

On WC1 I have a GridView.

I need to access a value in WC2 which is defined on the GridView
RowEditing event in WC1.

So what I did was:

1. Create a property in WC2 named "MyVal"

2. On my WC1 GridView RowEditing event I defined WC2.MyVal = "Test"

I added on WC2 Load event the code Response.Write(Me.MyVal). I get
nothing.

What am I doing wrong?

Thanks,

Miguel
Elroyskimms - 24 Sep 2007 19:03 GMT
> I have a page with 2 web controls. WC2 is inside WC1 as follows:
>
[quoted text clipped - 17 lines]
> I added on WC2 Load event the code Response.Write(Me.MyVal). I get
> nothing.

It sounds like you may be doing this in the wrong order. When you
click to edit the GridView, the postback will first run the Load event
handlers for WC1 and WC2. The last thing to be run is the WC2
RowEditing event handler. So, at the time of WC2.Load, the Edit event
code has not been executed, so the value has not been set. The WC2
code which uses the property MyVal needs to be called after the
RowEditing event in WC1. If you put it in its own method, you could
call it:

'Inside the WC1 RowEditing event
WC2.MyVal="Test"
WC2.MyFunctionName()

This will run the function in WC2 after the MyVal has been set.

HTH,

-E

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.