asp.net gridview的简单问题希望有人可以回答^ _ ^第2部分 [英] asp.net gridview simple question hope someone can answer ^_^ part 2

查看:55
本文介绍了asp.net gridview的简单问题希望有人可以回答^ _ ^第2部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.在这里有几个问题(再次).好吧,我想我可以在超链接上做到这一点,但是我的任务是使用imagebutton并将其重定向到另一个带有查询字符串的查询字符串,例如http://localhost:1884/TrainingPlan/Admin/UserUpdate.aspx?Username ="blahblah" '.现在我在这里得到一个错误.有人可以帮我(再次^ _ ^)

Hello again guys. Got a few question here (Again). Alright I think I could do it on hyperlink but my task is to use imagebutton and redirect it to another with query string such as this one http://localhost:1884/TrainingPlan/Admin/UserUpdate.aspx?Username=''blahblah''. Now im getting an error here. Could someone help me (Again ^_^)

<asp:GridView ID="gvUserList" runat="server" AutoGenerateColumns="false">
    <Columns>
    <asp:BoundField HeaderText="Username" DataField="Username"  />

    <asp:TemplateField HeaderText="Name">
    <ItemTemplate>
        <asp:Label ID="lblfirstname" runat="server" Text='<%# Eval("Firstname")%>'> </asp:Label>&nbsp;
        <asp:Label ID="lbllastname" runat="server" Text='<%# Eval("Lastname")%>'> </asp:Label>
    </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField >
         <ItemTemplate>
             <asp:ImageButton ID="Imagebtnedit" runat="server" OnClientClick="window.location.href= <%#" UserUpdate.aspx?Username=" & Eval("Username")%>'"  />
        </ItemTemplate>
    </asp:TemplateField>


    </Columns>
    </asp:GridView>
    <br />
    <br />


谢谢,还有更多功能


Thanks and more power

推荐答案

您可以使用imagebutton的PostBackUrl属性
You can use PostBackUrl property of imagebutton


使用回发url属性
如果仍然出现错误,则发布您遇到的错误.
use postback url property
if still you are getting error then post which error you are getting.


这篇关于asp.net gridview的简单问题希望有人可以回答^ _ ^第2部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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