473,888 Members | 1,551 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

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?



Apr 22 '06 #1
0 1506

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

Similar topics

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
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.
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.
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
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...
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)")...
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.
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...
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!
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...
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...
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...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.