I am developing web application using Dot Net framework 2.0
On client side i am creating HTML elements(DIV,TextBox) at runtime using Javascript.
But i am not able to access them on server side using C#.
How to access dyanamically added elements on server side?
In some other function i can access these dynamically added elements by document.getElementById();
But how to access them on server side.
Here is Client side code

function addNewItem() 
{       

    var mainDiv=document.getElementById('MainDiv');

    var newDiv=document.createElement('div');
    newDiv.setAttribute('id','innerDiv');
    newDiv.setAttribute('runat','server');

    var newTextBox=document.createElement('input');
    newTextBox.type='text';
    newTextBox.setAttribute('id','txtAddr');
    newTextBox.setAttribute('runat','server');

    newDiv.appendChild(newTextBox);

    mainDiv.appendChild(newDiv);
    return true;
}

I think you should try JQuery.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.