473,624 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1435
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
4508
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 code to it to not allow execution of this script if the page was called from the <img> tag i.e..
4
1584
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 end) while the session state (data) is originated already somewhere from where ISessionObject fetches. When user Request another page the ISessionObject is again constructed and the data from original location is loaded from there. 2- Same with...
5
1140
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
1396
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 I look at it in PocketPC IE, the space is still there. I did CTRL+ refresh and reboot few times so that should not be the problem. Any ideas? --
1
876
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, copy them there.... what? 2. How do I know which files, exactly, to import to the web....all of the files in the project? 3. How can I have the .asp page "inherit" the style of the FP web?
2
1623
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 command to close out the other session?
1
1448
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 update. Database or object is read-only. /Lvnw_New/step1.asp, line 391 and while i m useing CDONTS for sending mail i get alsot error like
1
7771
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 'asp.collapsiblepanelextender' 3. unknown server tag 'asp.UpdatePanel Why I am getting this error.? What should be done to fix it.
2
2096
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 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
0
8236
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
8679
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8335
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
8475
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...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
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
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
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
2
1482
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.