473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Regarding autogeneration of name attribute of input tag(Asp.net bu

What I have seen in Asp.net applications that if i put two Asp buttons on the
web form(Aspx page)
it generates multiple name attribute of input tag on the client side.
for eg.

<asp:Button ID="btn" value="first" runat="server" name="btnname"/>
<asp:Button ID="Button1" value="second" runat="server" name="btnname"/>
After the execution it shows the result in following way:--
<input type="submit" name="btn" value="" id="btn" value="first"
name="btnname" />
<input type="submit" name="Button1" value="" id="Button1" value="second"
name="btnname" />
Here the problem looks that the "name" parameter has two values now one is
"Button1" and second is "btnname"
Which i think is incorrect
is their any explaination to this .

Oct 11 '08 #1
1 1414
its a bug in your code. asp:buttons do not have a name property. by
convention, any unknown properties of a server control are rendered as
attributes. the asp:button renders it own name attribute so it can
receive a postback (and fire the click). you should not use the name
attribute with any server control based on the html elements input,
select or textarea.

-- bruce (sqlwork.com)

Sumit Rawat India wrote:
What I have seen in Asp.net applications that if i put two Asp buttons on the
web form(Aspx page)
it generates multiple name attribute of input tag on the client side.
for eg.

<asp:Button ID="btn" value="first" runat="server" name="btnname"/>
<asp:Button ID="Button1" value="second" runat="server" name="btnname"/>
After the execution it shows the result in following way:--
<input type="submit" name="btn" value="" id="btn" value="first"
name="btnname" />
<input type="submit" name="Button1" value="" id="Button1" value="second"
name="btnname" />
Here the problem looks that the "name" parameter has two values now one is
"Button1" and second is "btnname"
Which i think is incorrect
is their any explaination to this .
Oct 11 '08 #2

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

Similar topics

2
by: Mike Kanski | last post by:
I have an asp page that contains a simple insert statement and redirect i.e.: Page1.asp <%oconn.execute "insert into table 1 values(1)" response.redirect "newpage.asp" %> I have to add some...
4
by: Fahad Ashfaque | last post by:
Hi, Please correct me if I go wrong anywhere in my understandings. 1- ISessionObject is created each time When any ASP Page is started executing and destroys on the page ends (not session...
5
by: Sridhar .M | last post by:
Any can help me, is ASP.net application run on any platform? or If i want to make an asp.net application Platform independent ( other than windows) is there any way to do it.
3
by: Goran Djuranovic | last post by:
Hi all, How do I get rid of a break (an empty row) before <form> tag in ASP.NET? I set the "topmargin=0" inside the <body> tag. When I look at the page on a regular IE, the space is gone, but when...
1
by: Grumpy Aero Guy | last post by:
1. If I create a simple .asp project with, say, 2 forms/pages and 1 module --- AND I wish to add this functionality to a Frontpage Web..... What's the approach? Import the files into the web,...
2
by: Dean R. Henderson | last post by:
For an ASP.NET web application, is there a way for one session (with appropriate security authorization) to set a HttpSessionState variable to point to another session and execute the Abandon...
1
by: akshar108 via DotNetMonster.com | last post by:
currently i m working on asp website when i upload all things with my database in ms access i get following error can any one help me Microsoft JET Database Engine error '80040e09' Cannot...
1
by: Valli | last post by:
Hi, I have an issue with the content page('default.aspx') while executing the asp.net project. I am getting the error 1. unknown server tag 'asp.Scriptmanager' 2. unknown server tag...
2
by: lunet | last post by:
hello, this has been asked before but no answers yet.. I need help! how can write a webservice method with attribute ? like this xml : <soap:Envelope...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.