Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > IsPostBack not true when clicking hyperlink column in a programmatically created datagrid

Reply
Thread Tools

IsPostBack not true when clicking hyperlink column in a programmatically created datagrid

 
 
TB
Guest
Posts: n/a
 
      04-22-2006
Hi All

For reasons unknown to me, the Page.IsPostBack is always false when I
click a link in a hyperlink column of a datagrid which is created
programmatically.

My code in a page called list.aspx:


sub creategrid()
dim Mydatagrid as datagrid = New DataGrid
Mydatagrid.ID = "mydatagrid"
Mydatagrid.PageSize = "5"
Mydatagrid.DataKeyField = "ID"
Mydatagrid.AutoGenerateColumns = False

etc, etc, and then:

Dim myboundcolumn As BoundColumn
myboundcolumn = New BoundColumn
myboundcolumn.DataField = "Name"
myboundcolumn.HeaderText = "Name"
myboundcolumn.ItemStyle.Width = Unit.Pixel(40)
Mydatagrid.Columns.Add(myboundcolumn)

Dim myhyperlinkcolumn As HyperLinkColumn
myhyperlinkcolumn = New HyperLinkColumn
myhyperlinkcolumn.HeaderText = "View"
myhyperlinkcolumn.DataNavigateUrlField = "ID"
myhyperlinkcolumn.DataNavigateUrlFormatString =
"list.aspx?detail={0}"
myhyperlinkcolumn.Text = "View details"
Mydatagrid.Columns.Add(myhyperlinkcolumn)
plhnews.Controls.Add(Mydatagrid) ' I add it to a placeholder control
on the page.

End sub

What do have to add to this code in order to ensure that IsPostback =
true when a link in the hyperlinkcolumn is clicked?

Thanks

TB

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM
Why Do IsPostBack and Master.IsPostBack Always Fire Twice? Joey ASP .Net 2 10-09-2008 06:17 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
datagrid - get the row's column value when clicking on a hyperlink cell vndaxanh@yahoo.com ASP .Net 2 01-23-2006 06:19 PM
HyperLink with IsPostBack= true Amirallia ASP .Net Web Controls 3 10-09-2005 12:20 AM



Advertisments