tags:

views:

21

answers:

2

I am creating a content web page which is inherited from BasePage. There is a drop down on the page.On selectedindex changed of dropdown i m filling some values in text boxes on the page.No error is coming.Even when debugging by applying breakpoint on selectedindexchnaged everything seems fine..But textboxes are empty after page load.Plzz help as i m going mad behind that prob..

A: 

If you could tap into the PreRender event, put a breakpoint there, and use the immediate window to evaluate the textbox's text value, to see if they still exist? Also check what else might be setting textbox Text property.

Lastly, if you are using an update panel, ensure the textboxes are also in that updatepanel region.

Brian
A: 

By your own description the text boxes are completed when the select box index is change. There is no onChange event fired when the page is first rendered. Assuming your onChange event calls a function, you can simply call this function as part of page load:

<script>
function doChange() {
    document.getElementById('feedback').value=document.getElementById('in1').selectedIndex;
}
</script>
<form name="testform">
    <select onChange="doChange();" id="in1"><option>a</option><option>b</option></select>
    <input type="text" id="feedback" name="feedback" value="z"/>
</form>
<script>
//Fills out the text box on page load
doChange();
</script>
Rudu