How to make dynamic page like in old(doh!) ASP

lucius01

New Member
Maybe I should think differently with this new asp+ but hey, we don&#039t loose bad habit that easily!<BR><BR>So here is my prob. :<BR> <BR>I got this asp tag:<BR> <asp:Button Text="Flag this product" onclick="Flag_it" runat="server" /> <BR><BR>and he need to run from the server since the Flag_it call is a VB procedure.<BR><BR>But I only want to show this button under certain condition(like when the page is postback or anything else...)<BR><BR>here is what I want in old good ASP<BR><BR><% if x=y then %><BR> my button tag goes here!<BR><%end if%><BR><BR>any help on how do do this??Add a Page.IsPostBack check:<BR><script runat=server><BR>Sub Page_Load(Source As Object, E As Event Args)<BR> If Page.IsPostBack Then<BR> Button1.Visible=True<BR> End If<BR>End Sub<BR></script><BR>.....<BR><asp:Button id=Button1 Visible=False Text="Flag this product" onclick="Flag_it" runat="server" /> <BR><BR>For comairing other things, you can write a custom function:<BR><BR>Sub checkValues(ByVal x As Integer, ByVal y As Integer)<BR> If x = y Then<BR> Button1.Visible=True<BR> Else<BR> Button1.Visible=False<BR> End If<BR>End Sub<BR><BR>Doug Seven<BR>CodeJunkies.Net / ASPNextGen.com<BR>[email protected]<BR>
 
Back
Top