国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
DataGrid模版列超級鏈接列傳遞參數(shù)問題總結(jié)(多個參數(shù)傳遞) [和訊博客]
DataGrid模版列超級鏈接列傳遞參數(shù)問題總結(jié)(多個參數(shù)傳遞)
[原創(chuàng) 2005-08-20 15:58:33 ] 發(fā)表者: CAROLhzj
 
 


1、存在小錯誤,總體方法是對的,使用java腳本

NavigateUrl="javascript:var win=window.open(‘<%# "ksmd.aspx?kcbh="+DataBinder.Eval(Container,"DataItem.課程編號")+"&ksrq="+DataBinder.Eval(Container,"DataItem.考試日期")%>‘,‘‘,‘height=250,width=700,top=250,left=150,toolbar=no,menubar=no,crollbars=no,resizable=no,location=no,status=no‘)"
2、

The DataGrid‘s HyperLinkColumn column is great to have a column with an hyperlink that points to an Url with a parameter whose value is taken from the data source, but what if you need to build the target Url with more than one parameter taken from the data source? In this case you can use a template column as follows:

<TemplateColumn>
    <ItemTemplate>
       <asp:HyperLink Runat="server" NavigateUrl=‘<%# "Details.aspx?EmployeeID=" & Container.DataItem("ID")&"&EmployeeName=" & Container.DataItem("FirstName")%>‘/>
    </ItemTemplate>
</TemplateColumn>

Instead of doing the string concatenation yourself you can use the BuildUrlWithQueryString function, which must be declared with Public/Protected visibility in the code-behind, as follows:

<TemplateColumn>
    <ItemTemplate>
      <asp:HyperLink Runat="server" NavigateUrl=‘<%# _
         BuildUrlWithQueryString("Details.aspx", "EmployeeID", Container.DataItem("ID"),"EmployeeName", Container.DataItem("FirstName")) %>‘ />
   </ItemTemplate>
</TemplateColumn>

http://java.mblogger.cn/brian_jin/posts/2792.aspx

<asp:TemplateColumn HeaderText="購買">
<ItemTemplate>
<asp:HyperLink id=HyperLink1 runat="server"
 Text=‘<%# DataBinder.Eval(Container, "DataItem.dinggou")%>‘
 NavigateUrl=‘<%# "../gouwu/gouwu_ls.aspx?commoditytype=" &
  DataBinder.Eval(Container, "DataItem.commoditytype")
  & "&commodityname=" & DataBinder.Eval(Container, "DataItem.commodityname")%>‘ />
</ItemTemplate>
</asp:TemplateColumn>

3、

<Asp:TemplateColumn HeaderText=="欄目名稱">
 <itemTemplate>
<asp:HyperLink Text=‘<%# DataBinder.Eval(Container, "DataItem.ica_name") %>‘ NavigateUrl=‘<%# "newsdetail.aspx?id="+DataBinder.Eval(Container, "DataItem.ica_id")+"&name="+DataBinder.Eval(Container, "DataItem.ica_name") %>‘ runat="server"/>
 </itemTemplate>
</Asp:TemplateColumn>

4、固定的文字顯示用href
<asp:TemplateColumn HeaderText="標(biāo)題">
<HeaderStyle Width="14%"></HeaderStyle>
          <ItemTemplate>
    <a href=content.aspx?postid=(<%#DataBinder.Eval(Container.DataItem,"postid")%>)‘>顯示</a>
          </ItemTemplate>
</asp:TemplateColumn>

5、DataGrid超級鏈接列(HyperLinkColum)中如何綁定一個以上字段,傳遞多個參數(shù)?

a.
<asp:HyperLinkColumn DataTextField="ffff" HeaderText="fff" NavigateUrl="a.aspx?x=<%# DataBinder.Eval(Container.DataItem, "字段名1")%>&s=<%# DataBinder.Eval(Container.DataItem, "字段名2")%>"></asp:HyperLinkColumn

b.
Page.Response.Redirect("repair_fitting_edit.aspx?repair_name="+MyDataGrid.Items[e.Item.ItemIndex].Cells[0].Text+"&fitting_get_day="+MyDataGrid.Items[e.Item.ItemIndex].Cells[1].Text+"&fitting_no="+MyDataGrid.Items[e.Item.ItemIndex].Cells[2].Text);

c.

先將datagrid轉(zhuǎn)換到模板列,然后在模板列中hyperlink的“屬性”—> “綁定”-> text 內(nèi)容里填寫以下內(nèi)容:

DataBinder.Eval(Container.DataItem, "字段名1") + DataBinder.Eval(Container.DataItem, "字段名2")

 

6、此方法未經(jīng)驗證:

<%
string Window;

Window = Request.QueryString["Window"];
%>

<frame src="left_tree_list_map.aspx?dm_tree=101&Window=<%=Window%>" name="leftFrame" scrolling="auto">

 

7、以上均為在頁面中直接編寫HTML實現(xiàn),此種方法直接編寫.cs文件

string connstr = @"Integrated Security=SSPI;User ID=sa;Initial Catalog=Northwind;Data Source=MyServer\NetSDK";

SqlConnection cnn=new SqlConnection(connstr);

SqlDataAdapter da=new SqlDataAdapter("select * from employees", cnn);

DataSet ds=new DataSet();

da.Fill(ds, "employees");

ITemplate temp= Page.LoadTemplate("webusercontrol1.ascx");

TemplateColumn tc=new TemplateColumn();

tc.HeaderText = "Last Name";

tc.ItemTemplate = temp;

DataGrid1.Columns.Add(tc);

DataGrid1.DataSource = ds;

DataGrid1.DataMember = "employees";

DataGrid1.DataBind();

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
csdn技術(shù)中心 初學(xué)asp.net時在論壇收藏收集的一些資料備忘
使用嵌套的Repeater控件顯示分級數(shù)據(jù)
AspNetPager1使用
DataBinder.Eval總結(jié)
C#(asp.net)實現(xiàn)數(shù)據(jù)導(dǎo)出Excel表詳細代碼
GridView 模板列中的數(shù)據(jù)綁定
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服