Forms Data Controls :: Make Gridview Row Link To Dynamically Numbered Document
Aug 16, 2010
I'm building an incident reporting site in ASP. I have a gridview listing incidents, with a unique dynamic number for each incident. SQL generates a report for each incident, and I need to create a hyperlink at the end of each gridview row linking to the associated numbered document so the report can be opened and printed.
Incident Number Incident Name Incident Description Incident Report
112 fred tall link
111 frank short link
110 bill wide link
The fields are populated by pulling data from SQL (names have been changed to protect the innocent!). The link for the document needs to contain the number from the dynamically generated Incident number. SQL creates a folder full of docs:-
IncidentReport112.xml
IncidentReport111.xml
IncidentReport110.xml
I'm guessing I need to add a hyperlink field to my gridview, and then need something to tell the url to point to IncidentReportxxx.xml, where xxx is the database's Incident Number field. I am very new to coding, I'm working in ASP, language VB, using Visual Studio 2008.
View 6 Replies
Similar Messages:
Oct 27, 2010
im just trying to use this answer, but im getting an error on my page:
"A field or property with the name 'returnantID' was not found on the selected data source."
Im not really sure what the "returnantID" is but it appears my page isn't liking it, not sure if i was sopposed to cswap it out for some other data or not.
This is my current gridview:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="Price" DataFormatString="{0:c2}" HeaderText="Price"
SortExpression="Price" />
<asp:BoundField DataField="Length" HeaderText="Length"
SortExpression="Length" />
<asp:BoundField DataField="Engine" HeaderText="Engine"
SortExpression="Engine" />
<asp:BoundField DataField="Colour" HeaderText="Colour"
SortExpression="Colour" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
</asp:GridView>
would just like the ProductName to link to the corresponding products page(using its Id)
p.s this is what i tried:
<asp:HyperLinkField DataNavigateUrlFields="returnantID" DataNavigateUrlFormatString="Details.aspx?id={0}" DataTextField="ProductName" NavigateUrl="Details.aspx" />
**Update** I changed the "returnantID" to "ProductName" which turned the name of my product into a link but clicking that link gave me this new error:
Input string was not in a correct format.
View 5 Replies
Jul 31, 2010
i have 2 dropdownlist and gridview. Im trying to make a link after displaying the relational data in the gridview like below But how can i get the value and combine with the link
[Code]....
this is the all of my code
[Code]....
View 2 Replies
Oct 6, 2010
I am trying to add/insert linkbutton dynamically inside gridview row, below is the code
[Code]....
Problem I facing is that the data table is getting created fine with teh linkbutton as well but the gridview is not showing the linkbutton. upon executing I am only the column which is of string type.
View 4 Replies
May 7, 2015
i have made a gridview which contains three fields, two textboxes and one combo box. ComboBox fetchs data from table(SQL) and when a combox box triggers, data related to combo must be added in two boxes. i did this throw another button, but i want this to be trigger directly when it clicks.
View 1 Replies
Jan 25, 2011
I would like to keep this post in Getting Started for a while before moving to specific section.
I have on my asp.net a youtube embedded video using code as follows
However, instead of hard code them in my page, I want the video reference code "nTasT5h0LEg" below be flexible and dynamic using label1.text instead. Is this possible ? the following is the html code of the object. Is it possible to change it to
value=http://www.youtube-nocookie.com/v/"&Label1.text&"?fs=1&hl=en_US&rel=0
But intellisense says this is an error.
View 1 Replies
Oct 11, 2012
I wanna add a link and when it would be clicked then a pdf file will open in next tab of our browser.
View 1 Replies
Mar 15, 2010
I have two tables customers and sales . I have a formview that inserts to customers (new customers). I want every time I insert a new customer automatically redirect to another page where I will make a sale. On table sales I have a column CustomerID which I want to automatically take the auto numbered CustomerID from Customers table.
View 2 Replies
Nov 26, 2010
I use freetextbox control to rich text.When I insert an image with imagegalley it creates a link:
<A>http://www.freetextbox.com "target = _blank> FreeTextBox </ A>.
View 1 Replies
Jan 27, 2011
im developing website for my college.I have Recent updates in my home page in that i want to display newly added or updated things in recent updates.
sourcecode and Instructions for how to create link and how to redirect that to corresponding forms and how to create forms for particular updates dynamically then i want to make scroll the updates in GridView using Vb.net.
View 10 Replies
Mar 22, 2011
I am having one gridview in my asp form with one of the template field as imagebutton.
1. when i click on imagebutton the corresponding user profile opens in same tab....there is no option for open in new tab on right clickk..
open the user profilee in new tab.
View 16 Replies
Feb 15, 2010
I have two pages, the first one displays a list of products in a gridview, one column in the gridview is a hyperlink, this can be clicked on to get further details about the product. Each row in the gridview can be selected, certain details are added to an array (including the hyperlink column). I them want to display these details on page number two. All details are displayed except the hyperlink field.Has anybody any ideas as to what I'm doing wrong? The code is as follows:
[Code]....
and the second page:
[Code]....
View 6 Replies
Feb 23, 2011
If the user clicks on Inbox or Sent links, the inbox or sent tables with appropriate content taken from Message_Inbox database table should be shown on right. use asp.net panel controls hide/show to show/hide these tables. when user clicks on message subject link in these tables, the read-only view message page should be shown.
If the user clicks on Drafts link, the drafts tables with appropriate content taken from Message_Inbox database table should be shown on right.when user clicks on message subject link in these tables, the pre-composed form should be shown. the user should allowed to send or save this message.
I have the following code for the first part
protected void LnkButton_Click(object sender, EventArgs e)
{
LinkButton link = (LinkButton)sender;[code].....
View 7 Replies
Mar 25, 2010
How do I configure a column in the gridview to display a users name as the text and email address in a the mailto: link from the code behind page using C# so when the user clicks on the name it will open the default email client with the email address instead of the name?
View 4 Replies
Jul 9, 2010
i'm new to asp.net environment. i want to ask, i put column hyperlink at gridview. i click link and it will direct to another page that have textbox in it. how i want to pass info from gridview and display it at texboxt at next page?
View 5 Replies
Jun 28, 2010
I believe my SQL statement is sound. UPDATE [062610] SET abc = @abc FROM [062610] WHERE (dayID = @dayID) I cant seem to get my stupid variable @abc to sync with my GridView update command. I understand that I can let the GridView take care of my editting for me without having to write any code. But, I am running multiple tables and will be eventually needing to do this manually. Or at least as far as I know.
View 3 Replies
Sep 28, 2010
<asp:TemplateField ShowHeader="false" ItemStyle-Width="50px">
<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<% string.Format("~/Tiff.aspx?Id={0}, Eval("ID")) %>' Target="_blank" Text="View" />
</ItemTemplate>
</asp:TemplateField>
When I m trying to click on it...It is not working or not firing any event,
May I know the reasong or any code behing is require
View 6 Replies
Jan 13, 2011
I have a Gridview of a database which displays the PDF files which I have uploaded onto the website.
I want to add a link/button to each record so that when I click it it opens the PDF file in Adobe Acrobat.
View 3 Replies
Jun 1, 2010
here's my url: http://nathan/mail/incomingmail.aspx?dc=8250&bg=-617370170
gridview code:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataSourceID="SqlDataSource1" [code]...
View 1 Replies
Dec 30, 2010
How can one disable a Link Button in gridview. In gridview, I had defined linkbutton as :
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkbtndownload" runat="server" CssClass="Links" CommandName="DownloadPdf" CommandArgument='<%#Eval("Client_ID")%>'>Download</asp:LinkButton></td>
</ItemTemplate>
</asp:TemplateField>
View 2 Replies
Mar 24, 2011
I Want to be able to replace this bitfield:
<asp:TemplateField HeaderText="Banned" SortExpression="bitBanned">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# ShortDisplay("bitBanned") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
with a link in my gridview that toggles the bit with a method from my dblayer
The ShortDisplay() method seen above looks like this:
protected string ShortDisplay(string strPerm)
{
string result = string.Empty;
if (Eval(strPerm) != null && (string.Compare(Eval(strPerm).ToString(), "True", 0) == 0))
result = "Yes";
else
result = "No";
return result;
}
As you can see it returns just a "yes" or "no", would like it to be a link when the bit is "Yes"
View 1 Replies
Dec 13, 2010
Is there a way based on the current user that when the page loads that the Delete option on the gridview is disabled?
View 1 Replies
Jan 24, 2011
I have a link button for one of the columns of the gridview, What I need to do to save the value that the link button has in the gridview on a text box and how can I open a new page on that link button
View 2 Replies
Jan 28, 2010
I have a gridview with edit, update and delete functioanlity.
I do also have a checkbox boolean field.
If checkbox1 is checked then I want to hide or disabled the delete button.
checkbox is in item template and Delete is not in item template, if i have to make the field of delete templeted then I will.
View 15 Replies
Feb 19, 2010
I am trying to create a basic gridview which has the basic edit and delete capabilities on a webpage using the MVC framework.I have bound the gridview to a LINQ Data source and I can retrieve all my records with no problem. However, when I click on the EDIT link, nothing happens at all. I have assigned my DataKey and viewing all the videos and tutorials on creating a gridview, this was how it is to get a gridview working.Steps taking:1) Created LINQ datacontext2) Created Controller 3) Created Index view4) Drag-and-dropped Gridview control onto Index view and link it to LINQ.5) Enabled CRUD functions on LINQ Datasource and Enabled Editing on Gridview.Can someone please tell me what is wrong or missing? I have tried different ways of getting this to work for 3 days now and I am at my wits end.
View 2 Replies