views:

105

answers:

2

Hi.

I have one aspx page with some controls. Also i have one DIV which is dynamically populated from AJAX call. This AJAX call return couple of controls, for example HtmlInputText1 and HtmlInputText2.

When page is submitted, I can get values from this controls through Request.Form. If possible access to the attributes of this control on pege code behind (for example HtmlInputText1.Height, etc).

I think that is impossible, but I am not sure. I can use hidden field. Is any other way?

+1  A: 

The data you want the server to know can be set by the javascript within the form. Then You can process postback data for the target values manually.

You can write some javascript which modify the value of the server control within browser.

<script language="javascript" type="text/javascript">
function changeValue() {
    var txtControlClient = document.getElementById('<%= txtControl.ClientID %>');
    txtControlClient.value = "modified text";
}
</script>

In the expected event, you call changeValue() function before the postback, then you can just use server control object txtControl to obtain the value or property you have altered.

codemeit
A: 

The data you want the server to know can be set by the javascript within the form. Then You can process postback data for the target values manually.

How to make this?

SelvirK