Re: Do all ASP buttons do submit?
- From: "Jason Kester" <jasonkester@xxxxxxxxx>
- Date: 30 Oct 2005 15:43:12 -0800
Randall Parker wrote:
> How do you tell them not to post back? Is there some attribute in a flag?
That's just HTML:
<input type="button" onclick="myClientSideFunction()">
> Also, you refer to:
> <input type=submit runat=server>
>
> Why would one put runat=server on a tag that will become an HTML page tag? The input
> tag is not asp:input. It is just plain input. I thought runat=server was only used
> for tags that you want the ASP.Net pre-processor to translate into something else.
No. runat=server is available for any HTML tag. <br id="myBR"
runat=server/> is perfectly valid, and will be available to you as a
HtmlGenericControl on the server.
Take a look at the HTML generated by <asp:button> for an answer to your
question. It will render as <input type=submit>, plus a bunch of
script. The question you will eventually want to ask youself is, since
it's rendering as an INPUT anyway, why not declare it as one?
> Though I'm an ASP.Net novice and I still do not understand some basics. So maybe I'm
> wrong.
Try to learn a bit about HTML and CGI programming outside of the
context of ASP.NET. Seriously, install Perl or PHP on a server and
write some simple database tools. It will take away a lot of
misconceptions about the things that ASP.NET is doing for you behind
the scenes.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
>
.
- Prev by Date: Re: Exam 70-305
- Next by Date: Re: treeview and autopostback
- Previous by thread: Re: Insert records from Excel
- Next by thread: Re: treeview and autopostback
- Index(es):