473,761 Members | 7,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsPostBack not true when clicking hyperlink column in a programmaticall y created datagrid

TB
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
programmaticall y.

My code in a page called list.aspx:
sub creategrid()
dim Mydatagrid as datagrid = New DataGrid
Mydatagrid.ID = "mydatagrid "
Mydatagrid.Page Size = "5"
Mydatagrid.Data KeyField = "ID"
Mydatagrid.Auto GenerateColumns = False

etc, etc, and then:

Dim myboundcolumn As BoundColumn
myboundcolumn = New BoundColumn
myboundcolumn.D ataField = "Name"
myboundcolumn.H eaderText = "Name"
myboundcolumn.I temStyle.Width = Unit.Pixel(40)
Mydatagrid.Colu mns.Add(mybound column)

Dim myhyperlinkcolu mn As HyperLinkColumn
myhyperlinkcolu mn = New HyperLinkColumn
myhyperlinkcolu mn.HeaderText = "View"
myhyperlinkcolu mn.DataNavigate UrlField = "ID"
myhyperlinkcolu mn.DataNavigate UrlFormatString =
"list.aspx?deta il={0}"
myhyperlinkcolu mn.Text = "View details"
Mydatagrid.Colu mns.Add(myhyper linkcolumn)
plhnews.Control s.Add(Mydatagri d) ' 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

Apr 22 '06 #1
0 1497

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

Similar topics

2
2230
by: Amir Eshterayeh | last post by:
Dear Friends I put a asp.net hyperlink control inside a datagrid as even a template column or hyperlink column but can not force datagrid to open a new window when I clicked on the hyperlink. I set the Target of Hyperlink to _top, _blank, _parent ,... but it navigate to that url from the current page and I must click back to return to grid. Please help. Thank you in advance for your attention. Andy Eshtry andyeshtry@hotmail.com
2
2669
by: Alex | last post by:
I would like to have one column in my DataGrid that content acts as a hyperlink. In addition to that I would like that the content is databound to a DataSet source. If I create a hyperlink column in VS.NET I loose the databinding feature for that column. If I choose a data bound column I don't get the hyperlink formatting and actions.
9
15022
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring = datagrid.Items(rownumber).Cells.Item(column number).Text returns a blank string. It seems to work ok for the other columns that are just regular datagrid columns, not hyperlink types. Thanks. -- Paul G Software engineer.
2
2240
by: LmcE | last post by:
Hi, I have created a datagrid with a template column containing a datalist. However, I need the text within the datalist to display as a hyperlink. Eack of the links will point to another form with 2 parameters passed in. Has anyone any ideas how to add the hyperlink? Many Thanks
6
2942
by: epigram | last post by:
I'm using the DataGrid with AutoGenerateColumns set to false and choosing which columns I want in the grid by using the <Columns> attribute. What I want to do is to create a hyperlink out of one of the columns that I am displaying, but in order to build this link, I need a value that is in my SELECT clause, but is not being displayed via a BoundColumn. Say I have a query: SELECT ID, Name FROM Companies Here, ID is the PK. I am only...
2
2259
by: Jason | last post by:
I have a data grid with a hyperlink column. The hyperlink is created by a class that extracts the link from an XML Document. How can I populate the hyperlink column in the data grid with the value (link) returned from my class method? I have to send the company ticker to the class in order to get the correct link. I tried embedding the method into the NavigateURL property of the data grid (i.e. NavigateUrl="GetCompanyLink(Ticker)")...
10
1944
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign a column of URLs to this hyperlink column in programming way (ie., dynamically assignment). However, I can not find a way to continue doing it. Do you have ideas about it? Thanks.
5
3966
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a DataGrid on my page. This works well, however, like I said, I would like to keep from having to fill the DataView on each PostBack. So, naturally, what I did was checked whether or not the request was a PostBack by checking the IsPostBack...
2
2147
by: vndaxanh | last post by:
Hi everyone, I have an aspx page with a datagrid column which bound to a dataset at page_load. It contains 2 columns, Key and Hyperlink. What I want to do is when I click on the hyperlink it will set a session variable to the Key column like so: Session = column 0 of row of the hyperlink clicked on. How do I do this? Thanks in a advance for your help!
0
9531
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
9345
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
10115
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...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9775
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...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3881
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
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
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.