|
-
Aug 5th, 2008, 01:20 PM
#1
Thread Starter
PowerPoster
[RESOLVED] ASP Buttons
What is the difference between the true logic and the false logic here?:
Code:
<%If CLng(Request.Cookies("SESS")("typ")) = CLng(ADMIN_TYP) Then%>
<INPUT TYPE=SUBMIT NAME="EditFunction" VALUE="Delete Customer">
<%Else%>
<INPUT TYPE="Button" NAME="Delete" VALUE="Delete Customer" ONCLICK="verifydeletecust();">
<%End If%>
Specifically, what is the difference between TYPE=SUBMIT and TYPE="Button" ?
Thanks.
-
Aug 7th, 2008, 02:10 PM
#2
Re: ASP Buttons
Type="Submit" will submit the form along with all of the fields.
Type="Button" will not submit the form, it will only do what's in the onclick. In this case, it probably calls the javascript method which in turn asks "Are you sure?" and then submits the form.
-
Aug 8th, 2008, 02:48 PM
#3
Thread Starter
PowerPoster
Re: ASP Buttons
And what about this?
<INPUT TYPE=RESET VALUE="Reset">
If I changed my textboxes on this asp page and then decide, for example, I was editing the wrong customer, I just hit this Reset button and all the data go back to their original values on the client. I am sure I can't do this in asp.net easily and without a postback!
-
Aug 11th, 2008, 02:39 PM
#4
Re: ASP Buttons
There is no <asp:Reset> control, but you can place an <input type="reset"> on the page itself and it will act just as a normal reset button does.
-
Aug 13th, 2008, 10:08 AM
#5
Thread Starter
PowerPoster
Re: ASP Buttons
Wow - that was so very cool!
And it's okay to mix them up like this?:
Code:
<asp:Button ID="btnUpdate" runat="server" Text="Update" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
<input type="reset" value="Reset">
-
Aug 13th, 2008, 02:12 PM
#6
Re: ASP Buttons
Yes, because in the end the <asp:Button> is rendered out as <input type="submit">. It's the same thing as using <asp:Button> along with a <table> in a page. One is ASP.NET markup, one is HTML. You can mix anything.
-
Aug 13th, 2008, 02:20 PM
#7
Thread Starter
PowerPoster
Re: ASP Buttons
Thank you. I had these same three buttons on another page which I rushed through so I just went back and put them there too. I will keep these in my pocket for the future...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|