响应重定向来自数据列表内部标签的查询字符串 [英] Response redirect Query string from label inside of a datalist

查看:79
本文介绍了响应重定向来自数据列表内部标签的查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下我的datalist片段。



I have the following snippet of my datalist.

<asp:DataList ID="DataList3" runat="server" RepeatColumns="3" CellSpacing="10" CellPadding="10"><ItemTemplate><table cellpadding="0" cellspacing="0" class="style8" width="400px"><tr><td bgcolor="#CCCCCC" align="center">Install Date: <%# DataBinder.Eval(Container.DataItem, "installDate", "{0:MM/dd/yyyy}") %></td></tr><tr><td bgcolor="#99CCFF" align="center" colspan="1"><asp:Label ID="InstallName_2WA" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "installName") %>' Visible="true"></asp:Label></td></tr><tr><td bgcolor="#99CCFF" class="style11" colspan="1" align="center"><%# DataBinder.Eval(Container.DataItem, "equipInstalled") %></td></tr></table><table cellpadding="0" cellspacing="0" style="border: thin solid #000000" 

                                    width="400px"><tr><td bgcolor="#FF8484" class="style17"> </td><td bgcolor="#FF8484" class="style19">Clinic Contacts:</td><td bgcolor="#FF8484"> </td></tr><tr><td bgcolor="#FFFFDF" class="style17" 

                                            style="border-style: none none solid none; border-width: thin; border-color: #000000">Name:</td><td bgcolor="#FFFFDF" class="style19" 

                                            style="border-style: none none solid none; border-width: thin; border-color: #000000">Role</td><td bgcolor="#FFFFDF" 

                                            style="border-style: none none solid none; border-width: thin; border-color: #000000">Phone Number:</td></tr><tr><td bgcolor="#FFFFDF" class="style18"><a href="mailto:<%# DataBinder.Eval(Container.DataItem, "contact1email") %>"><%# DataBinder.Eval(Container.DataItem, "contact1name") %></a></td><td bgcolor="#FFFFDF" class="style16"><%# DataBinder.Eval(Container.DataItem, "contact1role") %></td><td bgcolor="#FFFFDF" class="style12"><%# DataBinder.Eval(Container.DataItem, "contact1phone") %></td></tr><tr><td bgcolor="#FFFFDF" class="style17"><a href="mailto:<%# DataBinder.Eval(Container.DataItem, "contact2email") %>"><%# DataBinder.Eval(Container.DataItem, "contact2name") %></a></td></td><td bgcolor="#FFFFDF" class="style19"><%# DataBinder.Eval(Container.DataItem, "contact2role") %></td><td bgcolor="#FFFFDF"><%# DataBinder.Eval(Container.DataItem, "contact2phone") %></td></tr><tr><td bgcolor="#FFFFDF" class="style17"><a href="mailto:<%# DataBinder.Eval(Container.DataItem, "contact3email") %>"><%# DataBinder.Eval(Container.DataItem, "contact3name") %></a></td></td><td bgcolor="#FFFFDF" class="style19"><%# DataBinder.Eval(Container.DataItem, "contact3role") %></td><td bgcolor="#FFFFDF"><%# DataBinder.Eval(Container.DataItem, "contact3phone") %></td></tr><tr><td bgcolor="#FFFFDF" class="style17"><a href="mailto:<%# DataBinder.Eval(Container.DataItem, "contact4email") %>"><%# DataBinder.Eval(Container.DataItem, "contact4name") %></a></td></td><td bgcolor="#FFFFDF" class="style19"><%# DataBinder.Eval(Container.DataItem, "contact4role") %></td><td bgcolor="#FFFFDF"><%# DataBinder.Eval(Container.DataItem, "contact4phone") %></td></tr><tr><td bgcolor="#FFFFDF" class="style17"><a href="mailto:<%# DataBinder.Eval(Container.DataItem, "contact5email") %>"><%# DataBinder.Eval(Container.DataItem, "contact5name") %></a></td></td><td bgcolor="#FFFFDF" class="style19"><%# DataBinder.Eval(Container.DataItem, "contact5role") %></td><td bgcolor="#FFFFDF"><%# DataBinder.Eval(Container.DataItem, "contact5phone") %></td></tr>
                                            <tr><td bgcolor="#FF8484" class="style17"> </td><td bgcolor="#FF8484" class="style19">OS Personnel</td><td bgcolor="#FF8484"> </td></tr><tr><td bgcolor="#FFFFCC" colspan="3" align="center">Install Tech: <a href="mailto:<%# DataBinder.Eval(Container.DataItem, "installTechEmail") %>"><%# DataBinder.Eval(Container.DataItem, "installTech") %></a></td></tr><tr><td bgcolor="#FFFFCC" colspan="3" align="center">Secondary Install Tech: <a href="mailto:<%# DataBinder.Eval(Container.DataItem, "secondTechEmail") %>"><%# DataBinder.Eval(Container.DataItem, "secondInstallTech") %></a></td></tr><tr><td bgcolor="#FFFFCC" colspan="3" align="center" style="border-bottom-style: solid; border-width: thin; border-color: #000000">Help Desk Tech: <a href="mailto:<%# DataBinder.Eval(Container.DataItem, "helpdeskEmail") %>"><%# DataBinder.Eval(Container.DataItem, "helpdeskTech") %></a></td></tr><tr><td align="right" bgcolor="#CCCCCC" class="style17"><asp:Button ID="InstallChecklist_2WA" runat="server" OnClick="InstallChecklist_2WA_Click"

                                               Text="Install Checklist" /></td><td bgcolor="#CCCCCC" class="style19"> </td><td align="left" bgcolor="#CCCCCC"><asp:Button ID="L2W_Salesforce37" runat="server" Text="SalesForce" /></td></tr><tr><td bgcolor="#CCCCCC" class="style17"> </td><td bgcolor="#CCCCCC" class="style19"> </td><td bgcolor="#CCCCCC"> </td></tr><tr><td align="left" bgcolor="#CCCCCC" class="style18" colspan="3">Progress:<eo:ProgressBar ID="ProgressBar_2WA"  runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "progressCount") %>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "progressCount")%>'

                                                BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" ControlSkinID="None" 

                                                Height="16px" IndicatorColor="IndianRed" ShowPercentage="True" Width="250px"></eo:ProgressBar></td></tr></table><br></br></ItemTemplate></asp:DataList> 





In my code behind, I would like to pass the Label.text to the next page like so..



In my code behind, I would like to pass the Label.text to the next page like so..

protected void InstallChecklist_2WA_Click(object sender, EventArgs e)
   {
       Response.Redirect("tespage.aspx?InstallName_2WA=" + InstallName_2WA.Text);
   }





So far, it appears to be attempting to pass the variable but it never shows on the second page.



This is my first time using a datalist, so any help is appreciated.



Thanks!



So far, it appears to be attempting to pass the variable but it never shows on the second page.

This is my first time using a datalist, so any help is appreciated.

Thanks!

推荐答案

you write this code and it always redirect on testpage.aspx with querystring of current button text

you write this code and it always redirect on testpage.aspx with querystring of current button text
protected void InstallChecklist_2WA_Click(object sender, EventArgs e)
    {
        Response.Redirect("tespage.aspx?InstallName_2WA=" + ((Button)sender).Text);
    }


Hi Dustin Prevatt,

i did not get your point with your pasted code becuase you have mentioned an event code behind but its not referenced in datalist html so will you explain your issue in detail that what you want?
Hi Dustin Prevatt,
i did not get your point with your pasted code becuase you have mentioned an event code behind but its not referenced in datalist html so will you explain your issue in detail that what you want?


这篇关于响应重定向来自数据列表内部标签的查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆