RE: Gridview Hyperlink #2

Hey,

I just wanted to know how to add a link to a gridview when the rows are bound to data according to a web method?

I am using this web method:-

[WebMethod (Description = "This web method will display threads of specific forum.")]public DataSet GetDataSet(int id)

{

DataSet ds = new DataSet();

string database = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|/forum.mdb;Persist Security Info=True";

string queryStr = "SELECT (threads.thread_name) AS Thread, threads.thread_id, COUNT(posts.post_id) AS Replies, (threads.username) AS Author, max(posts.date_posted) AS Last_Post " +

"FROM threads INNER JOIN posts ON threads.thread_id = posts.thread_id WHERE threads.forum_id = '" + id + "' GROUP BY threads.thread_id, threads.thread_name, threads.username";

 

OleDbConnection myConn = new OleDbConnection(database);

OleDbCommand dbCommand = new OleDbCommand(queryStr, myConn);

OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(queryStr, myConn);

myConn.Open();

myDataAdapter.Fill(ds,
"threads");

myConn.Close();

return ds;

}

I consume the web method like this:-

static DataSet ds;protected void Page_Load(object sender, EventArgs e)

{

Label1.Text += Request.QueryString["name"];

int id = (System.Convert.ToInt16(Page.Request.QueryString["forum_id"]));localhost.Service myws = new localhost.Service();

ds = myws.GetDataSet(id);

GridView1.DataSource = ds;

GridView1.DataBind();

}

This displays the following information:-

Thread Replies Author Last_Post
Welcome 2 a 25/04/2009 14:35:24
ASP.Net 1 ole 25/04/2009 14:39:24
 

I want to be able to click on the name of the thread and take a user to "posts.aspx".. how can i do this?

Thanks

Regards

0
billy_111
5/4/2009 10:05:00 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
928 Views

Similar Articles

[PageSpeed] 25

Sorry please ignore this thread, its a duplicate.

Thanks

0
billy_111
5/4/2009 11:13:16 PM
Reply:

Similar Artilces:

Master Details in two seperate GridView Controls
I am simply trying to have a list of people in the top grid control (works fine), then when selected have the second Grid Control show details for that person(not working). Here is what I am trying from the load event: Sub BindData() Dim myConnection As New MySql.Data.MySqlClient.MySqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionSql")) Dim strPersonSQL, strActSQL As String strPersonSQL = "select row_id, first_name, last_name, middle_initial, dsi_id, created, created_by, program_of_study, email from tbl_person" Dim myPerCommand As New MySqlClient.MySqlComm...

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

GridView control exporting to Excel in Net 2.0
Well, I did my homework and found 33,868 references to issues with the gridview control and Excel, none of which were close to whats happening with my app. I have a Gridview control on my VB.NET main page and when I right click on it the popup allows me to export to Excel just fine..5-6 columns, less than 100 rows..when I do the same on another page I get an Excel error popup : "This web query returned no data.."..both grids have a (Select) button in the 1st column. The one that works is simply that...the one that doesn't has the Button.Text defined as something e...

RE: Outdated OID in Net::LDAP::Control::ProxyAuth? #2
>From: Graham Barr [mailto:gbarr@pobox.com]=20 >Sent: Thursday, March 03, 2005 7:05 PM >Thanks. Time has been short for me recently as I have been moving into=20 >a new house. ...But now I am in my house and have broadband access >once again. Congratulations on the new house. Long-live residential broadband! >OK. Actually this makes it even easier. We do not need the version=20 >parameter. The user should be able to provide one of proxyDN=20 >or AuthzId and the module will use the correct OID. > >Now my suggestion is: > > my $auth =3D N...

RE: Re[2]: Net::ftp
It is part of libnet and usually installed as part of core Perl install. Wags ;) -----Original Message----- From: Tim Musson [mailto:Tim@Musson.net] Sent: Monday, July 09, 2001 16:09 To: beginners@perl.org Subject: Re[2]: Net::ftp Hey Jorge, Monday, July 09, 2001, 5:36:33 AM, my MUA believes you used dtmail 1.3.0 @(#)CDE Version 1.4.2 SunOS 5.8 sun4u sparc to write: JG> Hi How I can install Net::ftp I try with ppm but I didn't find it JG> when I type search,I am under windows 98 and I wanted to install JG> a ftp client. What did you type? btw, I t...

Help! Find row on which a button was pressed in the gridview control in .NET 2.0
How do you get the exact row (and column data from that row)  on which a button was pressed within a gridview. In .NET v1 using the datagrid control the followingconstruction was available:objArgs.Item.Cells(n).Textusing the datagrid DataGridCommandEventArgs parameter. choices in gridview are     Sub cmdBackTestSummary(ByVal objSender As Object, ByVal objArgs As GridViewCommandEventArgs) ' objArgs.commandname ' objargs.commandarguement ' objargs.commandsource     End Sub but no objArgs.Item.Cells(n) So how do you get the exact row (and c...

GridView
Lets say my data is this in the DB - Column 1     Column 2          Column 3       Column 4        Column5date         <description>            $5                INV                 65date    ...

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

How to validate controls on a .NET 2.0 Web user Control
Hi Guys, (ASP.NET 2.0 / C#) I've looked thorugh every post on validating web user controls (and know about Pter Blum's Professional Validation and More package) - but can't seem to get my head around whre to start. I have a web user control, called wucICL.ascx on a we page called AddEditInvestment.aspx.  I would like to validate a couple of DropDownLists (ddlAccounts and ddlContacts) when the Insert and Update buttons are clicked on the AddEdit Investment page. The other controls on the AddEditInvestments page belong to a validation group called All Validators and the DropDownL...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

RE : RE : RE : RE : Regular expressions #2
No worries :-) It works now, thanks a lot :-) Best regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Foresti=E8res La Tuque, P.Q. Tel.: (819) 676-8100 X2833 shemond@smurfit.com=20 > -----Original Message----- > From: drieux [mailto:drieux@wetware.com]=20 > Sent: Wednesday, December 17, 2003 1:38 PM > To: Perl Perl > Subject: Re: RE : RE : RE : Regular expressions >=20 >=20 >=20 > On Dec 17, 2003, at 10:24 AM, drieux wrote: >=20 > > > > open(PS, "ps -efA|") or...

.Net 2
Hi Friends, I want to show Different Tabs for different information on my web form ( .aspx page ). I could not found Tab Control with .net 2005. I know there is some but couldnt find it. Can you please tell me from where can I add Tab Control to my web form ? Thanks in advance, Nirav With some tedious settings of properties on the menu control, it will behave like a tab control.  Then you need to use a multiview control and fill it with views.  Then you need to wire up the menu to the multiview or something.  I tried this before and it works, but we wrote our own contro...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

Web resources about - RE: Gridview Hyperlink #2 - asp.net.presentation-controls

Hyperlink - Wikipedia, the free encyclopedia
A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks. A software system for viewing ...

SA Supreme Court rules Dr Janice Duffy was defamed by Google through its hyperlinks, auto-complete and ...
A FORMER SA Health researcher has won a six-year legal battle against Google, proving she was defamed by the internet giant due to the way it ...

Banned hyperlinks could cost you $11,000 a day
The Australian communications regulator says it will fine people who hyperlink to sites on its blacklist, which continues to be controversially ...

ANALYSIS - Supreme Court hyperlink decision a victory for free speech
A hyperlink by itself should never be seen as 'publication' of other content, the Supreme Court said. But when it comes to libel the court did ...

Review: HyperLink is a great, inexpensive steel bracelet for the Apple Watch
Apple's own stainless steel link bracelet is too expensive for many of us to consider. HyperLink, however, is a less expensive alternative that ...

Apple's 'audio hyperlink' tech can control devices with inaudible sonic pulses
An Apple patent filing published by the U.S. Patent and Trademark Office on Thursday describes a method of encoding hyperlinks into an audio ...

Patent troll sending out invoices for image hyperlinks
A company named Vuestar thinks everyone who links images to pages on the Web …

How Effective Hyperlinks Can Help Your Blog
... link text explain exactly where the link is leading you or does it say something generic like click here ? When I saw Writing Effective Hyperlinks ...

Gmail's Shortcut for Inserting Hyperlinks
... doesn't mean Google shouldn't improve them. Many people complained that Gmail's rich text editor doesn't have a shortcut for inserting hyperlinks ...

Scientology loss keeps hyperlinks legal
The Church of Scientology loses a courtroom battle to compel a Dutch writer and her ISP to remove postings from a Web site, in a ruling that ...

Resources last updated: 12/18/2015 10:50:37 AM