Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Professional jQuery
| Search | Today's Posts | Mark Forums Read
BOOK: Professional jQuery
This is the forum to discuss the Wrox book Professional jQuery Cesar Otero, Rob Larsen; ISBN: 978-1-1180-2668-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional jQuery section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  Spam!  
Old September 13th, 2012, 12:58 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to access textbox inside EditItemTemplate?

HTML:
Code:
<!


DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<


html xmlns="http://www.w3.org/1999/xhtml">

 

<


head><link href="StyleSheet.css" rel="stylesheet" type="text/css" />

 



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>

 



<script src="jquery.js" type="text/javascript"></script>

 



<style type ="text/css">

 



.clsFind

 




{

 





}

 

</


style>

 



<title>

 

</


title></head>

 

<


body>

 



<form method="post" action="Default.aspx" id="form1">

 

<


div class="aspNetHidden">

 

<


input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />

 

<


input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />

 

<


input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="3Pmn9Z3SnssjpgmTk85Nr2jhTsqd5NHedGdkMUfV+2dPaqpHt7qp/2AWX9qOhiwAFCM9RHQI5rENTpeESwRy0ZZeQVBfClrV5iFUhbf7XplozcfU8eKGVqL1sFReaPgLR/lhLIWzA8NwfBS1ebYMSgbpdja4qj0SwaXKUAsibz3c2KENEyt08DUX5HwAazWpKdOm9jFalKOg+o0ui/NgbDZSHQ9SHJpIyQL7yahDzaJk0Jdd2phbtPcAp48UwabuL6/T2l2uo56gqvTyBoE6S9aF1hDQa7IEAFskaQtw4HqhvPz/66aaN/1Hj6K967JedxNCZCbNIy97gqHLD3C4HznIJBqxcp2gfBfkyA7CwO4=" />

 

</


div>

 

<


script type="text/javascript">

 

//<![CDATA[

 

var


 theForm = document.forms['form1'];

 

if


 (!theForm) {

 

theForm = document.form1;

 

}

 

function


 __doPostBack(eventTarget, eventArgument) {

 



if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

 

theForm.__EVENTTARGET.value = eventTarget;

 

theForm.__EVENTARGUMENT.value = eventArgument;

 

theForm.submit();

 

}

 

}

 

//]]>

 

</


script>

 

 

 

<


div class="aspNetHidden">

 



<input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />

 



<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="MEy46W8V6LdjyyEkxaS8Q3uielIKJ8u0QGKH77tD9QAVNTPLEp4rSVZbPSy4z9DPsJn/KADTdCOJVTfLBPoYQghZFTsikn1INk1acz34miDY09vW4qF+EQtlZKF44xIpea0TTMKkXGzADHlQAht/oA337ZeTL6m2WOhnu4CXwgk=" />

 

</


div>

 



<div>

 



<div>

 



<table cellspacing="0" rules="all" border="1" id="DetailsView1" style="height:50px;width:125px;border-collapse:collapse;">

 



<tr>

 



<td>id</td><td>2</td>

 



</tr><tr>

 



<td>myRow</td><td>

 



<span id="DetailsView1_Label2">Please type row number:</span>

 



<br />

 



<input name="DetailsView1$txtRowNumber" type="text" id="DetailsView1_txtRowNumber" csCssClass="clsFind" />

 



<input name="DetailsView1$TextBox1" type="text" value="B " id="DetailsView1_TextBox1" />

 



</td>

 



</tr><tr>

 



<td colspan="2"><a href="javascript:__doPostBack('DetailsView1$ctl01','')">Update</a>&nbsp;<a href="javascript:__doPostBack('DetailsView1','Cancel$0')">Cancel</a></td>

 



</tr><tr>

 



<td>Delete</td><td align="left" style="width:20%;">

 



<a id="DetailsView1_lnkDelete" class="clsFind" href="javascript:__doPostBack('DetailsView1$lnkDelete','')">Delete</a>

 



<a id="DetailsView1_lnkShow" class="clsFind" href="javascript:__doPostBack('DetailsView1$lnkShow','')">show</a>

 



</td>

 



</tr><tr>

 



<td colspan="2"><table>

 



<tr>

 



<td><span>1</span></td><td><a href="javascript:__doPostBack('DetailsView1','Page$2')">2</a></td>

 



</tr>

 



</table></td>

 



</tr>

 



</table>

 

</


div>

 







<br />

 



<input type="submit" name="btnShowControl" value="Show Delete Button" onclick="return ShowControl();" id="btnShowControl" />

 







<input type="submit" name="btnHideControl" value="Hide Delete Button" onclick="return HideControl();" id="btnHideControl" />

 



</div>

 



</form>

 

</


body>

 

</


html>


Code:
        <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" 
            AutoGenerateRows="False" DataKeyNames="id" DataSourceID="SqlDataSource1"
            AllowPaging="True" >
            <Fields>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
                <asp:TemplateField HeaderText="myRow" SortExpression="myRow">
                    <EditItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text="Please type row number:"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtRowNumber" runat="server" csCssClass ="clsFind"></asp:TextBox>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("myRow") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("myRow") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("myRow") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" />

                <asp:TemplateField  HeaderText="Delete" 
                                        ItemStyle-HorizontalAlign  ="Left"  
                                        ItemStyle-Width ="20%"> 
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDelete" 
                                            runat="server" 
                                            Text="Delete" 
                                            CommandName ="delete" 
                                            CssClass  ="clsFind">
                            </asp:LinkButton>
                            <asp:LinkButton ID="lnkShow" 
                                            runat="server" 
                                            Text="show"  
                                            CssClass ="clsFind">
                            </asp:LinkButton>
                        </ItemTemplate>

<ItemStyle HorizontalAlign="Left" Width="20%"></ItemStyle>
                    </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT * FROM [Table1]" 
            DeleteCommand="DELETE FROM [Table1] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [Table1] ([myRow]) VALUES (@myRow)" 
            UpdateCommand="UPDATE [Table1] SET [myRow] = @myRow WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="myRow" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="myRow" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <asp:Button ID="btnShowControl" 
                    runat="server" 
                    Text="Show Delete Button" 
                    OnClientClick ="return ShowControl();"/>
 
        <asp:Button ID="btnHideControl" 
                    runat="server" 
                    Text="Hide Delete Button"
                    OnClientClick="return HideControl();" />
My Question: Using JQuery/Javascript, how to access txtRowNumber?
Thanks

Last edited by Chaim; September 15th, 2012 at 03:36 AM.. Reason: Adding HTML




Similar Threads
Thread Thread Starter Forum Replies Last Post
AsyncFileUpload Or AjaxFileUpload Inside Listview EditItemtemplate won't work kafshdoozak BOOK: Beginning ASP.NET 4 : in C# and VB 6 January 5th, 2013 09:01 AM
AsyncFileUpload Or AjaxFileUpload Inside Listview EditItemtemplate won't work kafshdoozak BOOK: Beginning Ajax with ASP.NET 0 January 3rd, 2013 07:03 AM
Change Text of Textbox inside Template DarkForce ASP.NET 2.0 Basics 3 September 14th, 2012 07:11 AM
get value of textbox inside datagrid khaink ASP.NET 1.0 and 1.1 Basics 9 October 2nd, 2007 10:05 AM
TextBox inside GridView michurin ASP.NET 2.0 Basics 2 January 13th, 2007 12:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.