选择其他按钮时,主页重新加载到iframe中

发布于 2025-01-18 04:52:24 字数 1110 浏览 4 评论 0原文

我有一个页面(银行),其中包含多个“按”按钮。我也有一个由搜索选项缩小的GridView。缩小缩小后,您可以选择一个按钮(套件),然后使用有关套件的所有信息,然后将另一页(卡)加载到旁边的iframe中。一切都很好,直到我使用页面上的其他搜索按钮(完善或更改我要搜索的内容)。发生的是整个页面(银行)重新加载,并在iframe本身中重新加载。

在GridView中,我使用按钮“ ONCLICK”事件和“ OnClientClick”
OnClick事件将变量传递给“卡”页面,以检索正确的信息。

< asp:button ID =“ lblstarterkit” runat =“ server” text ='<%#bind(“ starterkit”)%>' width =“ 500px” height =“ 45px” cssclass =“ wrap” onclick =“ btnsk_onclick” commandargument ='<%#eval(“ id”)%>' OnClientClick =“ target ='cardFrame';“> </asp:button>

受保护的void btnsk_onclick(对象发送者,EventArgs e)

{

GridViewRow row = ((GridViewRow)((Button)sender).NamingContainer); 

int ID = Convert.ToInt32((sender as Button).CommandArgument);
string Functional = (row.FindControl("lblFunction") as Label).Text;
string CardStatus = (row.FindControl("lblCardStatus1") as Label).Text;

Response.Redirect(string.Format("SolutionKitCard_Bank.aspx?ID={0}&Functional={1}&CardStatus={2}", ID, Functional, CardStatus ));

}

我很确定我缺少Java脚本来支持这一点,而且我发现了很多。我尝试了一些...但它无法正常工作。请帮忙。

I have a page (BANK) with multiple "search by" buttons. I also have a gridview that narrows down by the search options. Once you narrow it down, you can select a button (kit) and in turn another page (CARD) loads into the iframe next to it with all the information about the kit. Everything works well until i use the other search buttons on the page (refine or change what I am searching for). what happens is the whole page(BANK) reloads with-in the iframe itself.

in the Gridview I am using Button "OnClick" event AND "OnClientClick"
The Onclick event is passing variables to the "CARD" page in order to retrieve the right information.

<asp:Button ID="lblStarterKit" runat="server" Text='<%# Bind("StarterKit") %>' Width="500px" Height="45px" CssClass="wrap" OnClick="btnSK_OnClick" CommandArgument='<%#Eval("ID") %>'
OnClientClick="target ='cardframe';">
</asp:Button>

protected void btnSK_OnClick(object sender, EventArgs e)

{

GridViewRow row = ((GridViewRow)((Button)sender).NamingContainer); 

int ID = Convert.ToInt32((sender as Button).CommandArgument);
string Functional = (row.FindControl("lblFunction") as Label).Text;
string CardStatus = (row.FindControl("lblCardStatus1") as Label).Text;

Response.Redirect(string.Format("SolutionKitCard_Bank.aspx?ID={0}&Functional={1}&CardStatus={2}", ID, Functional, CardStatus ));

}

I am pretty sure I am missing java script to support this and I have found alot out there. I have tried a few...and its just not working right. Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文