开发者

Dynamically changing an asp.net control's property

开发者 https://www.devze.com 2023-02-24 08:29 出处:网络
I\'m using two components from Essential Objects namely the downloader and file explorer. However that doesn\'t matter.

I'm using two components from Essential Objects namely the downloader and file explorer. However that doesn't matter.

The file explore (similar to window's file explorer) has a client API that can fire an event when I select a file using it. The event I fire uses a javascript function:

function file_selected(fe) {

var filename = fe.getSelectedFile(); foo(filename); }

The downloader has a property I want to update using the filename. How can I do this from the client side? In the code-behind it's easy: downloader.FilePath = ""; However the event only fires client side. I heard something 开发者_如何学Cabout ajax but as I have no experience with it, I'm struggling to find a solution.


This depends on the control and is not a general question about asp.net controls.

There is probably some documentation about it if there is an api. AJAX is nothing more than Asynchronous JavaScript and XML, so it doesn't feel like it is relevant to your problem.


You can embed the control into an UpdatePanel and change the value on the ServerSide as you described.
This control enables an implicit AJAX communication with your client and changes the value on the client side.

Some pages to update panels:

MSDN
Some Tutorial

0

精彩评论

暂无评论...
验证码 换一张
取 消