Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have one html table like below, so i need to edit cell values inline using javascript.
XML
<table id="myTable" width="50%">
    <tr>
        <% Html.BeginForm("Add","Holidays", FormMethod.Post); %>
            <td><input id="Date" type="text" name="date" style="width:250px"/></td>
            <td><input id="Description" type="text" name="Description" style="width:250px"/></td>
            <td><input type="submit" name="submitButton" value="Add" class="highlight"/></td>
        <% Html.EndForm(); %>
    </tr>
        <tr>
            <th>Date</th>
            <th>Description</th>
            <th>Edit</th>
        </tr>
    <%foreach (Holiday kvp in (IList<Holiday>)ViewData["Holidays"])
      {%>
    <tr>
        <td><%= kvp.Date.ToString("dd/MM/yyyy") %></td>
        <td><%= kvp.Description %></td>
        <td><%: Html.ActionLink("Edit", "Edit", "Holidays", new { year = kvp.ID.ToString("yyyy"), holidayid = kvp.ID, name = kvp.Description, date = kvp.Date },  new { @style = "color:Blue;font-size: 11px;text-decoration:none;" })%></td>
    </tr>
    <%} %>



    </table>


Please can help me.

Edit:
I mean just edit option on client side like below

Date Description
01/01/2013 Test1

now if i want change date as 02/02/2013 inline using javascript when i click on that date just change at client side like description.

Regards
Srinivas
Posted
Updated 28-Mar-13 3:11am
v2
Comments
Hariharan Arunachalam 28-Mar-13 7:54am    
By edit, do you mean to also have the data updated on the server side? or just have an edit option available on the client screen?
Hariharan Arunachalam 28-Mar-13 9:13am    
Are you willing to use/using jQuery in your pages?

1 solution

You should peruse this - JEditable[^]. This fits your requirement in my opinion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900