Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / November 2007

Tip: Looking for answers? Try searching our database.

JavaScript and ASP.NET web components properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dimitris Milonas - 05 Nov 2007 20:23 GMT
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
bruce barker (sqlwork.com) - 05 Nov 2007 22:46 GMT
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)

> 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
[quoted text clipped - 8 lines]
> Regards
> Dimitris
Dimitris Milonas - 06 Nov 2007 07:02 GMT
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

> 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
[quoted text clipped - 19 lines]
> > Regards
> > Dimitris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.