PC Review


Reply
Thread Tools Rate Thread

JavaScript and ASP.NET web components properties

 
 
Dimitris Milonas
Guest
Posts: n/a
 
      5th Nov 2007
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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?YnJ1Y2UgYmFya2VyIChzcWx3b3JrLmNvbSk=?=
Guest
Posts: n/a
 
      5th Nov 2007
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)


"Dimitris Milonas" wrote:

> 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
>
>
>
>

 
Reply With Quote
 
 
 
 
Dimitris Milonas
Guest
Posts: n/a
 
      6th Nov 2007
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)"
<(E-Mail Removed)> wrote in message
news:1BA01119-D47A-412F-B8CD-(E-Mail Removed)...
> 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)
>
>
> "Dimitris Milonas" wrote:
>
> > 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
> >
> >
> >
> >

>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
project with serviced components and non services components z f Microsoft ADO .NET 4 6th Oct 2005 02:14 PM
Cannot install any components in add/remove windows components =?Utf-8?B?TWVnYUppbQ==?= Windows XP Setup 2 6th May 2005 01:42 AM
What is the difference between framework components and application components? Julia Microsoft C# .NET 2 22nd Nov 2004 03:48 PM
Components added to a Components Surface not in Components Collection? Microsoft Microsoft Dot NET Framework 2 20th Feb 2004 08:42 PM
Parent/Child Components: How to make the child components go away when deleting the Parent. Patrick Vanden Driessche Microsoft VB .NET 5 14th Nov 2003 11:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 PM.