473,387 Members | 1,603 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,387 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 1569

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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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...

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.