Sending a session variable to a custom control

S

Scott

I have the following code in my aspx page which calls my custom control
(this works):

<cc1:matextbox id="matextbox1" runat="server">
<questioninfo typReportID= "This is where a number goes">
</cc1:matextbox>

This is fine for a test, but I really need it to use a session variable
instead of the text in the 2nd line. But when I change the 2nd line to look
like the following -

<questioninfo typReportID = '<%# session("reportNumber") %>'>

I get the error:

BC30676: 'DataBinding' is not an event of 'inputWebControls.QuestionInfo'

I don't get it. I am not databinding. I just want to pass a string to the
variable so I can use it in the logic in the control. The control is NOT
being built on the page in a grid, list or repeater, it is just in a <form>
tag, that's it. Anyone know why am I getting this error?

Scott
BTW: using VB in the behind code. :)
 
J

Jeffrey Tan[MSFT]

Hi Scott,

<%# %> is only used for DataBinding.
I think you should set your custom control's attribute in the code behind.
Custom control is actully a webcontrol, which abstract the attribute of its
HTML tag as properties.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top