473,654 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Submit in User Control

If I have one page aspx that is using two same user control, how can I know
in page load event of aspx that which id of user control is submit ?
Nov 17 '05 #1
2 2675
You get the SubmitControl ID in the Request.form
Collection - if you have two usercontrols with ids UC1
and UC2 and in both there is a button PbSubmit, and you
press PbSubmit in Uc2, request.form["UC2:PbSubm it"]
exists and
request.form["UC1:PbSubm it"] doesn`t exists. So you could
write in PageLoad:

if (!IsPostback)
{
if (request.form["UC2:PbSubm it"]!=null)
{ Uc2 submitted}
if (request.form["UC1:PbSubm it"]!=null)
{ Uc1 submitted}
}
-----Original Message-----
If I have one page aspx that is using two same user control, how can I knowin page load event of aspx that which id of user control is submit ?

.

Nov 17 '05 #2
Almost done.
But below routine is for checking there is user control in form or not but I
need to check that which submit button is pressed from user control.
"mike" <do*****@gmx.at > wrote in message
news:01******** *************** *****@phx.gbl.. .
You get the SubmitControl ID in the Request.form
Collection - if you have two usercontrols with ids UC1
and UC2 and in both there is a button PbSubmit, and you
press PbSubmit in Uc2, request.form["UC2:PbSubm it"]
exists and
request.form["UC1:PbSubm it"] doesn`t exists. So you could
write in PageLoad:

if (!IsPostback)
{
if (request.form["UC2:PbSubm it"]!=null)
{ Uc2 submitted}
if (request.form["UC1:PbSubm it"]!=null)
{ Uc1 submitted}
}


Nov 17 '05 #3

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

Similar topics

1
2891
by: Daniel | last post by:
For an odd reason that I cannot figure out on my own, when a user attempts to log-in on my Log-In page, they must press the submit button twice. They fill out their credentials (username, password), then press submit. The postdata is indeed sent the first time around. I used echo to show the values. Then a second submit is required for the if control structor to initiate the log-in sequence. This happens on index.php, the login.php page...
2
8112
by: Laermans_k | last post by:
Hi, Does anyone have a solution to use the <input type="file" id="filechooser"> and the <input type="submit" id="submitbutton"> in 1 button click? I've already tried to create a javascript function behind the submitbutton click. In this function i call the filechooser.click() event and after this i call the functions to activate the progressbar of the upload. This doesn't seems to work:(
1
1058
by: george d lake | last post by:
Hi, I have a textbox and a listbox in a User Control When I click on a line in the listbox I populate the text box. This works perfect. No, on the page that has the UC in it, I also have a submit button. When I press submit, the textbox gets cleared, but if I enter something again and re submit I does not erase it. Any ideas?
2
3969
by: Owin | last post by:
Hi all, I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster. The control wordks great if autopostback is on. When there's a value in the textbox, the (overridden) textchanged event fires and validation is performed. Now I want to turn off autopostback. So I want my contol only validate if the submit button is pressed. I've tried Page.Validate(), but It seems...
4
15683
by: owingruters | last post by:
Hi all, I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster. The control wordks great if autopostback is on. When there's a value in the textbox, the (overridden) textchanged event fires and validation is performed. Now I want to turn off autopostback. So I want my contol only validate
3
1450
by: PJ6 | last post by:
When I have client-side script like this - document.forms.submit('test') how do I access, from server-side code, the value I put in the submit method? Also, is it possible to get the control's containing form name so I can emite script like this -
3
2424
by: Dabbler | last post by:
How do I tell wether I'm seeing autopostback vs submit button click in Page_load? Thanks for any clues.
7
2069
by: Bjorn Sagbakken | last post by:
Hello. There maybe an simple answer to this, but sometimes one get a strange blindness when working intensely on one single problem. I'm using ASP.NET 2003, building pages that include 3 user controls (banner, top-menu and sub-menu). The top-menu contains like five asp:buttons. Further down the form there is search field with another asp:button. And I naturally want this button to act as submit button in the sense that when
0
2131
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I'm having trouble working with a Summary Validation control. I need to click my submit button twice for the Summary to display when validation errors occur on the page. Background: My page contains a radio control which the user must answer to finish the page entry. If user hits submit button without selecting item from control, summary validation error displays. In this case one click is sufficient. Once the user selects choice on...
0
770
xarzu
by: xarzu | last post by:
OK, this must be a very very simple question for ASP programmers to answer. After I have gathered all the information I want from the user and after the user has clicked on a submit button, how do I make an operating system style call on the server. Now, I have already figured out how to create a function call in the ASP development environment that is called when the user clicks on the submit button. So my qesttion is to how to...
0
8285
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,...
0
8814
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
8475
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
7304
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...
1
6160
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
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
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
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.