473,396 Members | 1,866 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,396 software developers and data experts.

C'tor of WebUserControl

hi,

How can I call to a Function/Property and send data dynamically to the
UserControl ? I mean Instead (look at CurrentPage):
<Result:Header id="rh" CurrentPage="1" RecordsPerPage="2" runat="server" />
To do:
<Result:Header id="rh" CurrentPage="GetText()" RecordsPerPage="2"
runat="server" />

GetText() -> on the Webform...

(code was taken from your link below...)
http://openmymind.net/index.aspx?documentId=9

thanx,
Oren
Nov 19 '05 #1
4 1360
If you need two way communication, work in CodeBehind. If you simply need to
pull a value to the control, you can use the <%# %> tags to get at your Page
CodeBehind and have that get at control properties.

I believe the manner in which you are attempting is out of order, as the
tags are rendered after pre-render. I may be incorrect on that. If so, you
are asking for the constructor to pull information it will not have until
your property is populated.

Either way, it is easier to stick to CodeBehind if you want to start
customizing the way your app renders controls.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Oren" wrote:
hi,

How can I call to a Function/Property and send data dynamically to the
UserControl ? I mean Instead (look at CurrentPage):
<Result:Header id="rh" CurrentPage="1" RecordsPerPage="2" runat="server" />
To do:
<Result:Header id="rh" CurrentPage="GetText()" RecordsPerPage="2"
runat="server" />

GetText() -> on the Webform...

(code was taken from your link below...)
http://openmymind.net/index.aspx?documentId=9

thanx,
Oren

Nov 19 '05 #2
Gregory,

It still dosen't work:
<Result:Header id="rh" CurrentPage=<%#GetText()%> RecordsPerPage="2"
runat="server" />
.....
GetText()-> function/property on Webform

Oren

"Cowboy (Gregory A. Beamer) - MVP" wrote:
If you need two way communication, work in CodeBehind. If you simply need to
pull a value to the control, you can use the <%# %> tags to get at your Page
CodeBehind and have that get at control properties.

I believe the manner in which you are attempting is out of order, as the
tags are rendered after pre-render. I may be incorrect on that. If so, you
are asking for the constructor to pull information it will not have until
your property is populated.

Either way, it is easier to stick to CodeBehind if you want to start
customizing the way your app renders controls.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Oren" wrote:
hi,

How can I call to a Function/Property and send data dynamically to the
UserControl ? I mean Instead (look at CurrentPage):
<Result:Header id="rh" CurrentPage="1" RecordsPerPage="2" runat="server" />
To do:
<Result:Header id="rh" CurrentPage="GetText()" RecordsPerPage="2"
runat="server" />

GetText() -> on the Webform...

(code was taken from your link below...)
http://openmymind.net/index.aspx?documentId=9

thanx,
Oren

Nov 19 '05 #3
On Mon, 17 Oct 2005 11:33:02 -0700, "Oren"
<Or**@discussions.microsoft.com> wrote:
Gregory,

It still dosen't work:
<Result:Header id="rh" CurrentPage=<%#GetText()%> RecordsPerPage="2"
runat="server" />
....
GetText()-> function/property on Webform


Oren: What is happening? Are you getting a runtime error or just no
value? With data binding expressions like <%# %> you need to explicity
call DataBind on the control or on the page to have the expression
evaluated.

http://msdn.microsoft.com/library/en...xpressions.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4
Hi Gregory,

Please let me explain again:

I have WebUserControl on a Webform.
How can I sent dynamically to the WebUserControl from a Function/Property on
the Webform ? (data="2" is a static way)
<uc:myuc id="myid1" CurrentPage=<%#GetText()%> data="2" runat="server"/>
.....
GetText()-> function/property on the Webform, returns string and send it to
the WebUserControl -> <%#GetText()%>

It's not working. no data is being send. any idea why ?

thanx,
Oren

"Scott Allen" wrote:
On Mon, 17 Oct 2005 11:33:02 -0700, "Oren"
<Or**@discussions.microsoft.com> wrote:
Gregory,

It still dosen't work:
<Result:Header id="rh" CurrentPage=<%#GetText()%> RecordsPerPage="2"
runat="server" />
....
GetText()-> function/property on Webform


Oren: What is happening? Are you getting a runtime error or just no
value? With data binding expressions like <%# %> you need to explicity
call DataBind on the control or on the page to have the expression
evaluated.

http://msdn.microsoft.com/library/en...xpressions.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #5

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

Similar topics

0
by: Christian | last post by:
Hi, I try to change the position of a WebUserControl on my WEbform (layout is set to GridLayout) by changing the absolute position in the html-code but it does not work. When I change the...
0
by: Mike Levin | last post by:
Hello Group, I'm using VisualStudio.NET and put a DataGrid into a WebUserControl (an ascx file). For the DataGrid element, I have set AllowSorting="True" and OnSortCommand="Grid_Sort".
2
by: Arun | last post by:
I am new to ASP.NET I need some help for this scenario The scenario is like this I have a template Page which loads a WebUserControl (uct1.ascx) inside a PlaceHolder (PH1) Now this Web User...
1
by: DichkoSoft | last post by:
Hi I create WebUserControl and very confused when use control For Example: ***************************** *wuc.ascx ***************************** <script id=clientEventHandlersJS...
0
by: Christian H | last post by:
Hello, I've just created a WebUserControl that consists of a few other controls such as DropDownList, TextBox and Button. Based on the information entered in the DropDownlist, and TextBox, the...
2
by: Oren | last post by:
Hello everyone... I have a simple WebUserControl with Button and TextBox on it. Webform1.aspx contains this WebUserControl. How can I create my own C'tor for this WebUserControl - I mean when I...
2
by: Oren | last post by:
Hi everyone, I have WebUserControl on a Webform. How can I sent dynamically to the WebUserControl from a Function/Property on the Webform ? <uc:myuc id="myid1" CurrentPage=<%#GetText()%>...
0
by: Giovanni | last post by:
Dear Friends, I have a decision to make and hope to get some insight: I have built several WebUserControls one of which is a WebUserControl that queries an SQL server database, retrieves a...
0
by: Klaus Jensen | last post by:
Hi In a repeater-control, in the <SeparatorTemplatei have placed a webusercontrol, I have made. That works great- However, I want to know be able to only display this WebUserControl a certain...
1
by: deeparengan | last post by:
hi in asp.net i have a webusercontrol that has three dropdownlist.In the first dropdownlist i loaded the data at design time and in second dropdownlist i load the some data at run time according to...
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: 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
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
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
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
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...

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.