Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 ^_^)
XML
<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
Posted
Updated 28-Sep-11 20:38pm
v2

use postback url property
if still you are getting error then post which error you are getting.
 
Share this answer
 
v2
Comments
janwel 29-Sep-11 2:43am    
hahahah i thought it was onclick thanks again ^_^
You can use PostBackUrl property of imagebutton
 
Share this answer
 
Comments
janwel 29-Sep-11 2:43am    
thanks sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900