| | |
how should i do it?
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
Hi,
In the code shown below if you want to pass values to next page containing primary key of the record then change the code to
In the code shown below if you want to pass values to next page containing primary key of the record then change the code to
ASP.NET Syntax (Toggle Plain Text)
<asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "ServerID")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "ServerID")+ ">Delete</a>" %>'></asp:Label>
If u r query is achieved,mark the thread as solved
Live and Let Live
Live and Let Live
•
•
Join Date: Feb 2006
Posts: 399
Reputation:
Solved Threads: 14
hi,
I still get errors do I need something in the server side code?:
Code is as follows:
I still get errors do I need something in the server side code?:
ASP.NET Syntax (Toggle Plain Text)
Compiler Error Message: CS0103: The name 'ch' does not exist in the current context Source Error: Line 39: <asp:TemplateField HeaderText="Action"> Line 40: <ItemTemplate> Line 41: <asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Delete</a>" %>'></asp:Label> Line 42: </ItemTemplate> Line 43: <ItemStyle HorizontalAlign="Center" />
Code is as follows:
ASP.NET Syntax (Toggle Plain Text)
<asp:GridView ID="ListOfServers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New" Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center" ToolTip="This table contains the current list of monitored servers." Width="95%"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ServerID" HeaderText="ServerID" InsertVisible="False" ReadOnly="True" SortExpression="ServerID" /> <asp:BoundField DataField="HostName" HeaderText="HostName" SortExpression="HostName" /> <asp:BoundField DataField="MachineType" HeaderText="MachineType" SortExpression="MachineType" /> <asp:BoundField DataField="Kernel" HeaderText="Kernel" SortExpression="Kernel" /> <asp:BoundField DataField="SerialNo" HeaderText="SerialNo" SortExpression="SerialNo" /> <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP" SortExpression="PrimaryIP" /> <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Delete</a>" %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </asp:TemplateField> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView>
If my post helped add to my rep!
Change
And change frmagents.aspx to your page.
Always post the error details otherwise it will be difficult for others to identify the problem.
DataBinder.Eval(Container.DataItem, "Id") by DataBinder.Eval(Container.DataItem, "ServerID") And change frmagents.aspx to your page.
Always post the error details otherwise it will be difficult for others to identify the problem.
MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
•
•
Join Date: Feb 2006
Posts: 399
Reputation:
Solved Threads: 14
Hi,
I still get the error ch does not exist in the current context does it need to be decalred in the aspx.cs page?:
code now reads:
I still get the error ch does not exist in the current context does it need to be decalred in the aspx.cs page?:
code now reads:
ASP.NET Syntax (Toggle Plain Text)
<asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=monitor.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "ServerId")+ ">Delete</a>" %>'></asp:Label>
If my post helped add to my rep!
YES PUT THE LINE
public char ch = '"'; just above your page load method like protected void Page_Load(object sender, EventArgs e) MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Asp.net javascript confirmation box not cancelling
- Next Thread: Update Web.config from windows application
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





