473,395 Members | 1,936 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,395 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 1571

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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.