Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 08:55 AM
Authorized User
 
Join Date: Aug 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!! I am completely stuck...

I am trying vainly to get two webusercontrol.ascx (WUC) to work together.
My issue seems huge.

I thought it would be easy to create a WUC (Cal.ascx) containing a calendar control, select a date from a calendar control and somehow use that event to pass the date as a parameter to another (results.ascx) that would a) use the parameter and b) start an event to process a data access procedure to fill a date grid with results.

Simple? 5 days of reading and experimenting and absolutely nowhere.

My issue is fundemental. I have even created a testbed.aspx to try understand what it is I dont know, and things are getting even worse. I found a document on the web which claims to deal with mastering page-usercontrol communications but it does not help, although proves it should be possible. The article is badly written and the examples unworkable for me.

At this moment, I have the following questions

1) Is there a nice working example (Wrox?) I've read two of their asp.net books to no avail. If I could see an example of one control (including code) working with another on the same page it might help.
2) Could anyone explain what the process is (with working examples). I cant even figure out how to set a property in a WUC from a process on the page and then use the property value later. That question will explain just how little I understand about classes and inheritance and stuff.

Sorry, but i come from the world of SQL\Access VBA were event driven programming seemed easy. I cant believe that ASP.NET (in this aspect) is so scary.

On a positive note, The date access with SQL capabilities are so easy with ASP.Net. I was absolutely flying along until I hit this.

I am using VS (VB) 2003

Regards


 
Old May 6th, 2005, 11:02 AM
Authorized User
 
Join Date: Aug 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK – I continue to try and learn here,

I can create a populated dataset on the Page.aspx.
SqlDataAdapter.Fill(DataSet11) ‘I’ve tested this and it works

I then create an instance of the class from the Results class on the Results.ascx resident on the Page.ascx
Dim MyDataSet as New Results
I then store the dataset in a property in the Results class
MyDataSet.Info ‘ This seems to work
And then a run a public sub in the Results class
MyDataSet.DoIt()


In the
Public Sub DoIt() ‘I want to fill a repeater (called Repeater1 on the Results.ascx
Me.Repeater1 = New System.Web.UI.Webcontrols.Repeater
‘I don’t know why I’ve put the above line, but the debugger allows it
Me.Repeater1.DataSource=Info ‘This appears to pass the dataset11 stored in the property
Me.Repeater1.DataBind() ‘should in theory fill the Repeater…..

…..But it doesn’t

When the page completes the repeater is empty.

And this is the crux of my problem. What do I not understand????


 
Old May 9th, 2005, 08:04 AM
Authorized User
 
Join Date: Aug 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the latest on this.
It seems my solution might lie in the "Events and Delegates" arena. According to MSDN and Event can be raised in one object (the event sender) and captured by another object (the event receiver). In the middle of this is an intermediary, a special type called delegate.

If anyone has/knows of a working example of this with Web User Controls and Web page I'd appreciate seeing it and the code.

Have got acres of MSDN reading on this, the perfect cure for insomnia!!

 
Old May 9th, 2005, 02:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This might not help in understanding how things work now, but I can highly recommend the book: Developing Microsoft ASP.NET Server Controls and Components (http://www.amazon.com/exec/obidos/tg...glance&s=books)

It will give you valuable information about how controls interact, life cycle of a control, events, delegates (and how to to trigger them).

For the short term: why not have an event handler in the main page that is triggered by control 1 that in turn calls a method on control 2?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Sinking Feeling by The The (Track 3 from the album: Soul Mining) What's This?
 
Old May 12th, 2005, 03:35 AM
Authorized User
 
Join Date: Aug 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the book suggestion. I've ordered it. In the mean time I've had considerable success with an article on events and delegates from Microsoft. I've built myself a working model and now am applying it to my project. Fingers crossed.

 
Old May 12th, 2005, 04:50 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

If wish you can go through this related link

http://prashantprof.blogspot.com/200...nicate-in.html

Prashant







Similar Threads
Thread Thread Starter Forum Replies Last Post
Fail to signout completely SpringSummer ASP.NET 1.0 and 1.1 Basics 2 April 11th, 2007 11:01 AM
Completely Stumped Admiral1701 Classic ASP Professional 6 December 5th, 2006 02:35 PM
Help - I'm Completely Stuck hugh@kmcnetwork.com ASP.NET 1.x and 2.0 Application Design 1 May 16th, 2006 10:12 AM
can't close a winApp completely csc820203 C# 4 July 19th, 2004 03:12 PM
help me in uninstalling MySQL completely ankit_29882 MySQL 3 March 22nd, 2004 05:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.