Prev: Error form control XXXcontrol is not a member of form
Next: Cache not working as expected when using list(of integer)
From: Betty on 26 Jul 2010 15:05 Hi, If I want a button non-clickable until a link above the button is clicked(i.e., an legal informational page is viewed then a user can go on to the next page by clicking the button), how can I implement it? thanks, -- Betty
From: mick0987b on 26 Jul 2010 17:08 This any good for you? <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Redirect("nextpage.aspx") End Sub Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Button1.Enabled = True End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">This is the link, click this first</ asp:LinkButton> </div> <asp:Button ID="Button1" runat="server" Enabled="False" onclick="Button1_Click" Text="Button" /> </form> </body> </html>
From: Betty on 27 Jul 2010 14:38 Hi Mick, Thanks for the post. It's very helpful. -- Betty "mick0987b" wrote: > This any good for you? > > > <%@ Page Language="VB" %> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > <script runat="server"> > > Protected Sub Button1_Click(ByVal sender As Object, ByVal e As > System.EventArgs) > Response.Redirect("nextpage.aspx") > End Sub > > Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As > System.EventArgs) > Button1.Enabled = True > End Sub > </script> > > <html xmlns="http://www.w3.org/1999/xhtml"> > <head runat="server"> > <title></title> > </head> > <body> > <form id="form1" runat="server"> > <div> > > <asp:LinkButton ID="LinkButton1" runat="server" > onclick="LinkButton1_Click">This is the link, click this first</ > asp:LinkButton> > > </div> > <asp:Button ID="Button1" runat="server" Enabled="False" > onclick="Button1_Click" > Text="Button" /> > </form> > </body> > </html> > . >
From: Cubaman on 28 Jul 2010 03:57
On Jul 26, 9:05 pm, Betty <be...(a)newsgroup.nospam> wrote: > Hi, > > If I want a button non-clickable until a link above the button is > clicked(i.e., an legal informational page is viewed then a user can go on to > the next page by clicking the button), how can I implement it? > > thanks, > -- > Betty You can also achieve the same result using javascript, avoiding postback an improving user experience. On link click: ClientScript.RegisterStartupScript(this, "document.getElementById('" + Button1.ClientId + "').enabled = true;", true); |