473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

passing variable into dynamic webusercontrol

GG
I 'm struggling with this for a while now and no matter what I do I
cannot get it to work.

Here's more or less what 's going on:

I'm creating Datagrids at runtime, and they contain a templatecolumn,
which I load from a webusercontrol; e.g.
....
Dim temp As ITemplate = Page.LoadTemplate("webusercontrol1.ascx")
dim tc as new TemplateColumn
tc.HeaderText = "bogus"
tc.ItemTemplate = temp
dgResults.Columns.Add(tc)
....

In the webusercontrol1.ascx I have (a.o.) the following:

<%#GetDetails(DataBinder.Eval(CType(Container, DataGridItem).DataItem,
"ID")%>

which is a function that uses a value from the dataset (and returns
temp)

Now I would actually want to change this function to include another
var that is defined earlier on the page (main page, not ascx), for ex.
<%#GetDetails((DataBinder.Eval(CType(Container,
DataGridItem).DataItem, "ID"), my2ndvar)%>

but i can't find a way to pass that info on. Even if i put it in a
session var, it isn't there when the ascx fires (?), why ? .
Can somebody please provide some help,
TIA !
Jul 21 '05 #1
0 1572

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: GG | last post by:
I 'm struggling with this for a while now and no matter what I do I cannot get it to work. Here's more or less what 's going on: I'm creating Datagrids at runtime, and they contain a...
2
by: John Smith | last post by:
With the code below, is it possible to access "strTemp" in "WebUserControl.ascx"? I always receive the error that "strTemp" is not available. As a workaround, I am using a Session variable, but I...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
1
by: ronniek | last post by:
Hi, I'm trying to load a WebUserControl (.ascx) into a PlaceHolder but I keep getting an exception that the Page Tree ViewState is modified. If I load the WebUserControl by the designer (not...
1
by: Robert Ward | last post by:
I am trying to load a web user control from code behind. This used to be something simple in .net 1.1 Dim myControl As ControlName = CType(Page.LoadControl("ControlName .ascx"), ControlName ) ...
9
by: zholthran | last post by:
Hi folks, after reading several threads on this issue (-> subject) I fear that I got a problem that cannot easily be solved by the offered workarounds in an acceptable way, at least not with my...
1
by: Jeremy Martin | last post by:
Hi, I am currently learning c# so be gentle :) I am converting a Delphi.NET website to c# website and I am confused as to how events are handled. 2 Situations. 1. A component on a...
2
by: Lloyd Sheen | last post by:
Ok I have created a small testbed site for testing and I am have a problem with the terms Usercontrol, Webcontrol, etc. What I need to do in the long run is have a page using AJAX and having...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.