473,799 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Link to work in datagrid???

Why doesn't my onEditCommand work???

I don't get an error it just doesn't do the page redirect as requested...

Thanks

...CODE..
Sub LinkButton_OnCl ick(ByVal sender As Object, ByVal e As
DataGridCommand EventArgs)
If e.Item.Cells(0) .Controls.Count > 0 Then ' Edit Link
If TypeOf (e.Item.FindCon trol("PageEdit" )) Is LinkButton Then
Response.Redire ct("../default.aspx?ID =1")
End If
End If
End Sub
...Datagrid..
<asp:datagrid id="DGPages" runat="server" BorderColor="Li ghtGray"
GridLines="Hori zontal" BorderWidth="1p x" BorderStyle="Ri dge"
AutoGenerateCol umns="False" Width="50%"
CellPadding="4" EditItemStyle-BackColor="#eee eee"
HeaderStyle-BackColor="Blac k" HeaderStyle-ForeColor="Whit e"
HeaderStyle-HorizontalAlign ="Center"
HeaderStyle-Font-Bold="True" ShowFooter="fal se" CssClass="txtAr ea"
AlternatingItem Style-BackColor="Whit eSmoke"
EnableViewState ="False" OnEditCommand=" LinkButton_OnCl ick">
<EditItemStyl e BackColor="#EEE EEE"></EditItemStyle>
<AlternatingIte mStyle BackColor="Whit eSmoke"></AlternatingItem Style>
<HeaderStyle Font-Bold="True" HorizontalAlign ="Center"
ForeColor="Whit e" BackColor="Blac k"></HeaderStyle>
<Columns>
<asp:TemplateCo lumn>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<img src="../images/page.gif">
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn HeaderText="Pag e">
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<%# Container.DataI tem("header") %>
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn HeaderText="Des cription">
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<%# Container.DataI tem("descriptio n") %>
</ItemTemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<asp:LinkButt on CommandName="Ed it" ID="PageEdit"
Runat="server"> <img border=0 src=../images/edit.gif alt='Edit
Page'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
</asp:TemplateCol umn>
<asp:TemplateCo lumn>
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
<ItemTemplate >
<asp:LinkButt on ID="PagePropert ies" Runat="server"> <img
border=0 src=../images/properties.gif alt='Page Properties'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateCol umn>
</Columns>
</asp:datagrid>

Nov 19 '05 #1
0 947

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2036
by: Colin McGuigan | last post by:
This is a translation of an ASP page to ASP.Net. First, the background: The goal is to have a grid of different settings for the application -- think something along the lines of the Property Page for a control. You have two columns -- the first column is a simple caption, and the second column can be one of a number of controls (textbox, checkbox, dropdownlist, etc) for each row. So row #1 might have a textbox in the second column,...
3
2128
by: Raymond Lewallen | last post by:
I have a modal dialog displaying a datagrid control. Click on the column header to sort the datagrid opens a new window with the following in the location: javascript:__doPostBack('dgDataGrid$_ctl1$_ctl1','') instead of actually posting back to the modal dialog and sorting the datagrid. ItemDataBound, ItemCommand events both work fine, only the SortCommand is producing this unwanted behavior.
2
1536
by: Luis E Valencia | last post by:
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid the link would be accoiones.aspx?iddireccion=2&idindicador=5 I tried this but doesnt work <ItemTemplate> <asp:HyperLink runat="server" id="Hyperlink2" NavigateUrl='acciones.aspx?iddireccion='<%# DataBinder.Eval(Container,"DataItem.iddireccion"%>'&idindicador='<%#
0
1186
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
5
1521
by: Luis E Valencia | last post by:
I need a link on a datagrid, the link must have fields of the database Like this acciones.aspx?iddireccion=1&idindicador=4 Thanks
0
2338
by: Henri | last post by:
Hi, I'm using a DataGrid with ViewState disabled, so I rebind data after each postback from the page's Sub OnLoad. Inside one of the DataGrid column, there is a custom LinkButton to trigger a Click event. When this button is clicked, it displays a form (outside the datagrid) so that the row can be edited. The code is:
2
2379
by: JenHu | last post by:
hi, I have a datagrid in my asp.net application, I am using vb.net language. I want to have my last column as a link column, link to text file. The link path is "c:\Temp\" & F_File_Name, which is the 2nd column. For example, the data grid should like this:
1
1805
by: BrainTop | last post by:
This is driving me nuts for last one week. Appreciate any assistance. I have ASP.NET web application with many pages. Some of them post back to itself and then links to another page. Everything was working great so far. Recently we did some modifications (included a new page) and after that things have gone ugly. This is the issue: Lets say the user has browsed through number of pages, came to one particular page (search), posted the...
7
7460
by: GaryDean | last post by:
I am writing a method in a component that gets passed a 1.1 Datagrid. The datagrid's columns were created at run time meaning it has no columns collection. How can I access Header and Footer data in the grid? It's not in the grid.items collection - only rows there. there is no grid.header or grid.footer. --
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.