472,374 Members | 1,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

why does HTML input button with runat="server" not cause postback?

Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris
Jun 10 '07 #1
4 13120
runat="server" makes the control available for asp.net in the page life
style, that is between the http request arrival and rendering the resulting
html. It doesn't effect any client-side behavior. Button server control
initiates postbacks not because of runat="server". Rather it comes with some
built-in client-side code.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Chris" <cc@dd.ddwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris


Jun 10 '07 #2
Chris wrote:
Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris
The Button control is rendered as an input with type="submit" in the
html code, that's why it's doing a postback.

The html input with type="button" doesn't do anything by itself. You
have to add some Javascript in the onclick event for it to actually do
anything at all.

--
Göran Andersson
_____
http://www.guffa.com
Jun 11 '07 #3
only the html form controls <input type=submitor <input type=image>
postback. the <input type=buttonis for firing client events without a
postback.

-- bruce (sqlwork.com)

Eliyahu Goldin wrote:
runat="server" makes the control available for asp.net in the page life
style, that is between the http request arrival and rendering the resulting
html. It doesn't effect any client-side behavior. Button server control
initiates postbacks not because of runat="server". Rather it comes with some
built-in client-side code.
Jun 11 '07 #4
Thanks

"Göran Andersson" <gu***@guffa.comschreef in bericht
news:uC**************@TK2MSFTNGP04.phx.gbl...
Chris wrote:
>Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input
button with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris

The Button control is rendered as an input with type="submit" in the html
code, that's why it's doing a postback.

The html input with type="button" doesn't do anything by itself. You have
to add some Javascript in the onclick event for it to actually do anything
at all.

--
Göran Andersson
_____
http://www.guffa.com

Jun 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Mulholland | last post by:
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file just fine. I have another page where i've done...
3
by: Libra Blue | last post by:
I try to set the page title dynamically in an aspx page, but sometimes an error occurs due to VS removing the runat="server" attribute at its own will... How do I stop from doing so?? Libra Blue
6
by: Martin Eyles | last post by:
Hi, I have a page that contains the following <div runat="server" id="Pikea"> <object runat="server" id="PiTV" style="width:560px; height:560px"...
3
by: Jaime Stuardo | last post by:
Hi all... Both controls are server side. The former has more properties. Both may have associated events that are ran at server. Which one are recommended to use? is performance an issue? in...
4
by: Ryan | last post by:
Hello, I have a standard HTML button on an aspx web form that I have set to runat server. The button is named reset1 and its tag is as follows: <INPUT id="btnReset1" style="WIDTH: 60px;...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
2
by: Bob | last post by:
Hi, in aspx file, i defined this: <input id="Button2" type="button" value="button" runat="server" onclick="klik()"/> This 'onclick' event is a clientclick (starting the Javascript function...
0
by: Bob | last post by:
When I use an ASP:Label with runat="server", and in JavaScript I use innerText on the ASP:Label, the Text property is not reflected in an event postback on the form. ASP:TextBox is not an...
19
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.