欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
DataGrid模版列超級鏈接列傳遞參數問(wèn)題總結(多個(gè)參數傳遞) [和訊博客]
DataGrid模版列超級鏈接列傳遞參數問(wèn)題總結(多個(gè)參數傳遞)
[原創(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="購買(mǎi)">
<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=="欄目名稱(chēng)">
 <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="標題">
<HeaderStyle Width="14%"></HeaderStyle>
          <ItemTemplate>
    <a href=content.aspx?postid=(<%#DataBinder.Eval(Container.DataItem,"postid")%>)‘>顯示</a>
          </ItemTemplate>
</asp:TemplateColumn>

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

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轉換到模板列,然后在模板列中hyperlink的“屬性”—> “綁定”-> text 內容里填寫(xiě)以下內容:

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、以上均為在頁(yè)面中直接編寫(xiě)HTML實(shí)現,此種方法直接編寫(xiě).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ù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
csdn技術(shù)中心 初學(xué)asp.net時(shí)在論壇收藏收集的一些資料備忘
使用嵌套的Repeater控件顯示分級數據
AspNetPager1使用
DataBinder.Eval總結
C#(asp.net)實(shí)現數據導出Excel表詳細代碼
GridView 模板列中的數據綁定
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久