JavaScript and ASP.NET web components properties

  • Thread starter Dimitris Milonas
  • Start date
D

Dimitris Milonas

Is there a way to get or set a property value of an ASP.NET web component? I
know that some properties can be accessed but with different names. For
example the "text" property of a button control can be accessed by using the
"value" property (i.e. from ASP.NET button1.text = "Sample" and with
JavaScript document.getElementById('button1').value = 'Sample').

But how can I get or set properties like "button1.PostBackURL" or
"button1.EnableViewState" with JavaScript? The same question applies to the
properties of a third party component.

Regards
Dimitris
 
G

Guest

asp.net server control in general do not support this. you need to understand
the html rendered by the control to know what can be modified. also with the
exception of the value, none of the properties are posted back so changing in
client will have no impact on the server after postback.

as viewstate is encrypted client script can neither view it or change.
looking at how postback url works, you can do it in client code (as it just
executes client script to implement this feature).

-- bruce (sqlwork.com)
 
D

Dimitris Milonas

I mentioned the two properties ("PostBackURL" and "EnableViewState") as an
example and not because I wanted to get or set these two particular
properties. But when you're saying that "...you need to understand the html
rendered by the control to know what can be modified..." you mean that if
the web button componenet is rendered as an <INPUT> tag then I need to know
how to manipulate the particular tag and not the button component itself. Is
that correct? The same applies to third party components?

Regards
Dimitris

"bruce barker (sqlwork.com)"
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top