How to specify multiple fields for the datanavigateurlfield of hyperlinkcolumn?

Source: Internet
Author: User
How to send DatanavigateurlfieldSpecify MultipleField? Tanrui (tanruy) Question on. NET Technology/ASP. NET at 10:43:52

I want the URL parameter of hyperlinkcolumn to have two fields:
Somepage. aspx? Id = 1 & name = Terry
The fields in the data source are ID and name,
What should I do?Datanavigateurlfield? Number of questions: 20. replies: 5top

Saucer (si gui) on the first floor)Back to 10:57:02 score 20

Hyperlinkcolumn doesn't support multiple parameters, use templatecolumn instead

<Asp: templatecolumn headertext = "View Details">
<Itemtemplate>
<Asp: hyperlink runat = "server" text = 'view details'
Navigateurl = '<% # "Page. aspx? Viewid = "& server. urlencode (container. dataitem (" listingno "))
"& Param2 =" & server. urlencode (dropdown1.selecteditem. Value) %>'

Id = "hyperlink1" name = "hyperlink1"/>
</Itemtemplate>
</ASP: templatecolumn>



See
Http://www.dotnetspider.com/Technology/KBPages/585.aspx
Top

2 floor webdiyer (Wuqi wa, northern Shaanxi)Back to 10:57:29 score 0

Use the template column or the findcontrol method in the itemdatabound event handler of the DataGrid to find the hyperlink of the corresponding column, and then specify its navigateurl attribute through the bound data. Top

Tongtianming on the third floor (cainiao also has a dream)Back to 11:01:32 score 0

<Asp: hyperlinkcolumnDatanavigateurlfield= "Num" datanavigateurlformatstring = "response. Redirect ('../YL/yl.htm? Id = {0} ') "datatextfield =" Link "headertext =" Link "> </ASP: hyperlinkcolumn>
<Asp: hyperlinkcolumnDatanavigateurlfield= "ID" datanavigateurlformatstring = "javascript: window. showmodaldialog ('viewdetail. aspx? Id = {0} '); "datatextfield =" ID "headertext =" ID "> </ASP: hyperlinkcolumn>
* ************* Datagride column TransferMultipleData *********

<Asp: templatecolumn headertext = "Remarks">
<Itemtemplate>
<Asp: hyperlink id = "hyperlink1" runat = "server" navigateurl = "editfit.pdf. aspx? Str1 = <% # databinder. eval (container. dataitem, 'id') %> & str2 = <% # databinder. eval (container. dataitem, 'cartype') %> "text = '<% # databinder. eval (container. dataitem, "Remarks") %> '>
</ASP: hyperlink>
</Itemtemplate>
</ASP: templatecolumn>
I wrote in the past, there are two ways to choose top

Layer 4 tnt8csdn2000 (Amber Yutian)Back to 11:41:45 score 0

Now that the template column is used, you can use linkbutton to write data in the background. Top

5 floor 46539492 (male dang Ziqiang (http://blog.csdn.net/46539492 ))Back to 11:45:46 score 0

Use the template column.
<Asp: templatecolumn headertext = "Remarks">
<Itemtemplate>
<Asp: hyperlink id = "hyperlink1" runat = "server" navigateurl = "editfit.pdf. aspx? Str1 = <% # databinder. eval (container. dataitem, 'id') %> & str2 = <% # databinder. eval (container. dataitem, 'cartype') %> "text = '<% # databinder. eval (container. dataitem, "Remarks") %> '>
</ASP: hyperlink>
</Itemtemplate>
</ASP: templatecolumn>
Or
<A href = "list. aspx? Id = '<% # databinder. eval (container. dataitem, "ID") '& Child =' <% # databinder. eval (container. dataitem, "child") '"> connection </a>
 

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.