How to change the PostBackURL on an ImageButton - programmatically


Author
Message
Howard Bennett
Howard Bennett
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 57, Visits: 496


Hello!



I'm wanting to change the PostBackURL on an image button based on the value in a text box. Here's my code:



protected void ImageButton2_Click(object sender, ImageClickEventArgs e)

{

if (this.txtCustomerCode.Text == "8868")



{

this.ImageButton1.PostBackUrl = "~/New Referral.aspx";

}



else



{

this.ImageButton1.PostBackUrl = "";

}

}



Right now - the button doesn't do anything...which is what I want if the Customer Code is incorrect. However - when the code is correct - it still does nothing. Can someone point me in the right direction here?



Thanks - HB
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search