Website code in asp.net that is dynamic

I have been assigned a project that seems challenging to do. On this webpage, I want a new section to be added under module* when "computer request" is clicked. The section will be called "cost center" with a textbox on the side to input information. I want it to look like the Subject* line with the textbox but instead of subject i want a new line under module.

All of the data is used dynamically. Could anyone point me in the right direction to where to start? Apparently I need to use client side code..

Answers


You might like to investigate the UpdatePanel control. This might help you do what you need.


placeholder is a very good choice for your scenario. It is useful when any user wants to bind a dynamic control and we can fix its position too. Very simple demo at : http://www.java2s.com/Code/ASP/Asp-Control/DealwithaspplaceholdercontrolfromcodebehindC.htm


why not create the item on the page and when the value "computer request" is selected, hide or show it? You can do this by setting the autopostback property on your dropdownlist to true and can test against it in your code behind.


If you want to do this completely in client-side code, just create the "Cost Center" row and set visibility to false. Then wire up the onchange event of the dropdown list to a javascript function that checks if the "Computer Request" item was selected. If it was, change the visibility to true. (You could also use jQuery to do this).

Edit

$(document).ready(function () {
    $('#yourSelectId').change(function() {
        var selectedVal = $('#yourSelectId option:selected').attr('value');
        if(selectedVal == computerRequestItemValue)
            $('#costCenterRow').show();
        else
            $('#costCenterRow').hide();
    });
});

Need Your Help

Error trying to add android platform to Cordova

android cordova npm

I'm running on ubuntu 13.10 and I've installed cordova using npm(if that makes a difference). When I create a project and then try to run cordova platform add android I get the following Error:

Cannot call parent fragment method from dialog fragment

android android-fragments

Apologies if this question has been answered, but I've been looking around for different things for the last two days and haven't been able to fix my code.