vb.net tips Six------hyperlinks in the DataGrid template column

Source: Internet
Author: User
Tags eval visual studio
datagrid| Tips | links | templates


Webform2.aspx file:

<%@ Page language= "vb" autoeventwireup= "false" codebehind= WebForm2.aspx.vb "inherits=" house. WebForm2 "%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name= "generator" content= "Microsoft Visual Studio. Net 7.1" >
<meta name= "Code_language" content= "Visual Basic. Net 7.1" >
<meta name= "vs_defaultClientScript" content= "JavaScript" >
<meta name= "vs_targetschema" content= "http://schemas.microsoft.com/intellisense/ie5" >
</HEAD>
<body ms_positioning= "GridLayout" >
<form id= "Form1" method= "POST" runat= "Server" >
<font face= "Song Body" >
<asp:datagrid id= "DataGrid1" style= "Z-INDEX:101; left:192px; Position:absolute; Top:16px "
runat= "Server" width= "560px" height= "590px" showfooter= "True" autogeneratecolumns= "False"
Bordercolor= "#336666" borderstyle= "Double" borderwidth= "3px" backcolor= "White" cellpadding= "4"
gridlines= "Horizontal" >
<selecteditemstyle font-bold= "True" forecolor= "white" backcolor= "#339966" ></SelectedItemStyle>
<itemstyle forecolor= "#333333" backcolor= "white" ></ItemStyle>
<footerstyle forecolor= "#333333" backcolor= "white" ></FooterStyle>
<Columns>

<asp:TemplateColumn>
<ItemTemplate>
<P>
<asp:textbox id=textbox2 runat= "Server" height= "88px" text= ' <% #DataBinder. Eval (Container, "dataitem.name")% > ' borderstyle= ' None ' readonly= ' True ' >
</asp:TextBox></P>
<P>
<asp:hyperlink id= "HYPERLINK2" runat= "server" Navigateurl= ' <% "show.aspx?name=" & DataBinder.Eval ( Container, "Dataitem.name")%> ' target= "_blank" > Personal information </asp:HyperLink></P>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<pagerstyle horizontalalign= "Center" forecolor= "white" backcolor= "#336666" mode= "NumericPages" ></ Pagerstyle>
</asp:DataGrid></FONT>
</form>
</body>
</HTML>
The blue background in the code above is the key, Navigateurl= ' <% # "Show.aspx?name=" & DataBinder.Eval (Container, "Dataitem.name")%> ' where show . aspx is the page that the hyperlink points to. Name is to be passed
Parameter name (arbitrarily taken), name in Dataitem.name is the field name of the data table being bound.
In the Show.aspx page, get the parameter values passed, OK.

Similarly, webform2.aspx files require WebForm2.aspx.vb files for data filtering and binding.
vb.net skill of the five.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.