473,756 Members | 3,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question about HTML control with runat="server"

Bob
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
"klik()" ).
I want to do a 'server onclick', just like the <asp:Buttoncont rol, but it
doesn't appear in the Intellisense nor in code-behind.

My question is:
is it possible to do an onclick event on the server?
If yes: how?
If no: what's the purpose of using an HTML input control with
runat="server"? What's the difference with a HTML input control not running
on the server (except it runs on the server), since it's not possible to
'onclick' on the server?

Thanks
Bob
May 21 '07 #1
2 2326
when you put a runat=server on an html control, it means the codebehind
can access the control and its properties. except for a small list of
html control, most end up as a generic html control. (asp.net does
support all input button varients).

in your case the <input type="button"do es not postback normally. it an
html control that only fires a client click in the browser. you can
cause a postback with client code or switch to type=submit which does
perform a browser postback. in this case you use onserverclick to
respond in the codebehind.
-- bruce (sqlwork.com)
Bob wrote:
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
"klik()" ).
I want to do a 'server onclick', just like the <asp:Buttoncont rol, but it
doesn't appear in the Intellisense nor in code-behind.

My question is:
is it possible to do an onclick event on the server?
If yes: how?
If no: what's the purpose of using an HTML input control with
runat="server"? What's the difference with a HTML input control not running
on the server (except it runs on the server), since it's not possible to
'onclick' on the server?

Thanks
Bob

May 21 '07 #2
Bob
Thanks

"bruce barker" <no****@nospam. comschreef in bericht
news:ei******** ******@TK2MSFTN GP06.phx.gbl...
when you put a runat=server on an html control, it means the codebehind
can access the control and its properties. except for a small list of html
control, most end up as a generic html control. (asp.net does support all
input button varients).

in your case the <input type="button"do es not postback normally. it an
html control that only fires a client click in the browser. you can cause
a postback with client code or switch to type=submit which does perform a
browser postback. in this case you use onserverclick to respond in the
codebehind.
-- bruce (sqlwork.com)
Bob wrote:
>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
"klik()" ).
I want to do a 'server onclick', just like the <asp:Buttoncont rol, but
it doesn't appear in the Intellisense nor in code-behind.

My question is:
is it possible to do an onclick event on the server?
If yes: how?
If no: what's the purpose of using an HTML input control with
runat="server" ? What's the difference with a HTML input control not
running on the server (except it runs on the server), since it's not
possible to 'onclick' on the server?

Thanks
Bob
May 21 '07 #3

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

Similar topics

2
2631
by: Lubomir | last post by:
Hi, I have a BoundColumn in a DataGrid: <asp:BoundColumn DataField="lastname" SortExpression="lastname" ReadOnly="True" HeaderText="Last Name"></asp:BoundColumn> Column is sorted. I am wondering why this code is working properly as there is missing the statement runat="server".
3
1442
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
5
2107
by: Matt | last post by:
I want to know what is the purpose of runat="server" attribute?? For example, for a submit button, it just submit the form data to the server, whats the differences between <input type="submit" name="submit1"> <input type="submit" name="submit1" runat="server"> Please advise! Thanks!!
6
2718
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" classid="clsid:{3DF152A5-521D-4330-A8DC-1424CEB66BAA}" VIEWASTEXT> </object> </div>
3
5538
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 what case I can (or must) use the second? If I want an input control that has specific font or color, I can use client side <input> so I'm wondering if there is an advantage to use <input> as
4
6535
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; HEIGHT: 24px" type="reset" value="Reset" name="btnReset1" runat="server"> Using Interdev I then double click the button in design view and in the code behind page (aspx.vb) have the following:
0
987
by: uto | last post by:
<uc1:uc_pager ID="Uc_pager1" runat="server" CurrentPage="<%=page%>" PageCount="<%=pageCount%>" PageSize="<%=pageSize%>" /> i'd like to input data into usercontrol when page loading but this <%= %> tag does't work how can i change this tage to work it?
0
1608
by: Tom | last post by:
I need to use DynamicHoverStyle. I read that in order to do so, I must add a <head runat="server" /> at the top of my UserCOntrol. When I do this though, my DynamicMenuItemStyle items get changed. If I take the <head runat="server" /> out of my userControl, my DynamicMenuItemStyle are fine. I tried it using a CSS file and class and a Skin, same results.
4
13308
by: Chris | last post by:
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
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9708
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.