473,503 Members | 13,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object/Control state

The Environment:
I have a 3rd party control referenced as an object on an aspx page with
inline code in script tags accessing the methods of properties of same. I
also have a Codebehind page handling all the non-object chores.

The Problem:
The object/control has as one of its properties 'FileName' which is a
string. I need to pass the value of that property to some container so that
my Codebehind page will have access to the value of that string.

Failed Solutions:
1)From within the inline sub I can change the .innerText of a div or span
but the Codebehind page doesn't "see" the container.
2)From within the inline sub an asp:label doesn't expose the normal .text
3)From within the inline sub trying to set a Session() variable errors out
saying 'type mismatch: Session' ... I've already checked IIS to make sure
saving Session variables is OKd

Any suggestions?
thx in advance,
S~
Nov 20 '05 #1
2 1492
Hi Seth,

If I understand correctly, the 3rd-party Control is client-side but you
want the server-side Code Behind to access one of the properties.

Have you tried using a hidden TextBox or other runat=server Control?

Or use a plain Html TextBox - not a WebForms Control. Then do a submit.

Or have the (plain) TextBox's onchange transfer the contents into a
WebForms TextBox which will submit itself.

Or have your inline code create the url = "http://blah.com?FileName=<file
name here>"

Regards,
Fergus
Nov 20 '05 #2
Cor
Hi Seth,
I did make something, I don't say it is nice but I thinks it works, when you
have a better solution some day, will you post it than here.
\\\

ASPX.VB part
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Button1.Attributes("onclick") = "javascript:settext(0);"
End Sub

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a As String = Me.TextBox1.Text
End Sub

ASPX html part
(some code around the body tag.)
<script type="text/javascript">
function settext(a){
if (a==1){document.all.item("textbox1").style.visibil ity="hidden"}
else {document.all.item("textbox1").innerText="some text";}}
</script>
</HEAD>
<body onload="settext(1);" MS_POSITIONING="GridLayout">
..........
////
It uses the input from the textbox to transfer data from the page to you.
I hope it helps you
Cor
Nov 20 '05 #3

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

Similar topics

2
10520
by: Pkpatel | last post by:
Hi, I keep getting this error every time I try to load crystalreportviewer on a webform with a dataset. Here is the error: -------------------------------------------------------- Server...
1
5189
by: Jim P. | last post by:
I'm having trouble returning an object from an AsyncCallback called inside a threaded infinite loop. I'm working on a Peer2Peer app that uses an AsyncCallback to rerieve the data from the remote...
1
7745
by: James G. Beldock | last post by:
I have seen the following behavior: when issuing a Page.FindControl() for a control which exists in an item template (from within an ItemDataBound() event, for example), I get nulls back...
9
2157
by: Moe Sizlak | last post by:
Hi There, I am trying to write the selected value of a listcontrol when a button is clicked and I keep getting the error "object not set to a reference of an object". The libox itself is in a...
6
1270
by: Brad | last post by:
I am creating a class (not a control) which implements IStateManager. I've created the class and all of the implementations (LoadView, SaveViewState, etc...). My Question is: How do I...
9
2089
by: Dennis | last post by:
When a class (myownclass) inheirits another class, how can I get an object reference to the underlyng MyBase class instance from within myownclass. The base class has a method that I want to...
7
2561
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
5
550
by: John Olbert | last post by:
Subject: Error is Object doesn't support this property or method I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX Control. I get the following runtime error-- "Object...
12
7478
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
1
1622
by: KhoaNguyen | last post by:
i have two classes..one is a base and the other is inherited from the base class Below is my code -------ConnectionProvider class--------------------- using System; using...
0
7213
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
7098
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
7298
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
7366
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...
1
7017
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
7471
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
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.