Hi,
I am using this code to prevent multi click asp.net 2.0 c#,
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("SetValue();");
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sb.Append("if (Page_ClientValidate() == false) { return false;
}} ");
sb.Append("this.value = 'Please wait...';");
sb.Append("this.disabled = true;");
sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit));
sb.Append(";");
this.btnSubmit.Attributes.Add("onclick", sb.ToString());
When I add this code to a page using a masterpage i get an error, "Objected
Expected"
I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but
nothing works.
Thanks
Andre 5 3212
Where is the btnSubmit control child or master page, is it inseide any other
controls;
Where is the code, Child or master page, what event handler is it in or
called from.
"André" wrote: Hi,
I am using this code to prevent multi click asp.net 2.0 c#,
System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("SetValue();"); sb.Append("if (typeof(Page_ClientValidate) == 'function') { "); sb.Append("if (Page_ClientValidate() == false) { return false; }} "); sb.Append("this.value = 'Please wait...';"); sb.Append("this.disabled = true;"); sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit)); sb.Append(";");
this.btnSubmit.Attributes.Add("onclick", sb.ToString());
When I add this code to a page using a masterpage i get an error, "Objected Expected"
I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but nothing works.
Thanks
Andre
on the Child,
this is the html :
<input type="submit" name="_ctl0:ContentPlaceHolder1:Button1" value="Button"
onclick="SetValue();if (typeof(Page_ClientValidate) == 'function') { if
(Page_ClientValidate() == false) { return false; }} this.value = 'Please
wait...';this.disabled =
true;__doPostBack('_ctl0:ContentPlaceHolder1:Butto n1','');WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("_ctl0:ContentPlaceHolder1 :Button1", "", true, "",
"", false, false))" language="javascript"
id="_ctl0_ContentPlaceHolder1_Button1" />
all the code is on the child, and i've tried page load, page int, page int
comp, all of them are giving me the same error.
I have this code on the preload event
// Button1.Attributes.Add("onclick", "document.aspnetForm." +
Button1.ClientID + ".value = 'Please wait.'");
this works but this isn't what I need.
Thanks
Andre
"clickon" wrote: Where is the btnSubmit control child or master page, is it inseide any other controls;
Where is the code, Child or master page, what event handler is it in or called from.
"André" wrote:
Hi,
I am using this code to prevent multi click asp.net 2.0 c#,
System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("SetValue();"); sb.Append("if (typeof(Page_ClientValidate) == 'function') { "); sb.Append("if (Page_ClientValidate() == false) { return false; }} "); sb.Append("this.value = 'Please wait...';"); sb.Append("this.disabled = true;"); sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit)); sb.Append(";");
this.btnSubmit.Attributes.Add("onclick", sb.ToString());
When I add this code to a page using a masterpage i get an error, "Objected Expected"
I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but nothing works.
Thanks
Andre
You should disable the submit button clientside on the first click
"André" <An**@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com... on the Child,
this is the html :
<input type="submit" name="_ctl0:ContentPlaceHolder1:Button1" value="Button" onclick="SetValue();if (typeof(Page_ClientValidate) == 'function') { if (Page_ClientValidate() == false) { return false; }} this.value = 'Please wait...';this.disabled = true;__doPostBack('_ctl0:ContentPlaceHolder1:Butto n1','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("_ctl0:ContentPlaceHolder1 :Button1", "", true, "", "", false, false))" language="javascript" id="_ctl0_ContentPlaceHolder1_Button1" />
all the code is on the child, and i've tried page load, page int, page int comp, all of them are giving me the same error.
I have this code on the preload event
// Button1.Attributes.Add("onclick", "document.aspnetForm." + Button1.ClientID + ".value = 'Please wait.'");
this works but this isn't what I need.
Thanks
Andre "clickon" wrote:
Where is the btnSubmit control child or master page, is it inseide any other controls;
Where is the code, Child or master page, what event handler is it in or called from.
"André" wrote:
> Hi, > > I am using this code to prevent multi click asp.net 2.0 c#, > > System.Text.StringBuilder sb = new System.Text.StringBuilder(); > sb.Append("SetValue();"); > sb.Append("if (typeof(Page_ClientValidate) == 'function') > { "); > sb.Append("if (Page_ClientValidate() == false) { return > false; > }} "); > sb.Append("this.value = 'Please wait...';"); > sb.Append("this.disabled = true;"); > > sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit)); > sb.Append(";"); > > this.btnSubmit.Attributes.Add("onclick", sb.ToString()); > > When I add this code to a page using a masterpage i get an error, > "Objected > Expected" > > I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but > nothing works. > > Thanks > > Andre
I have reg expression validators on there, if it fails to validate, then the
button is locked.
The code I have below works if it's not on a master page. I want/need to
understand why it's not working more so then anything else.
Thanks
Andre
"Jeff Dillon" wrote: You should disable the submit button clientside on the first click
"André" <An**@discussions.microsoft.com> wrote in message news:EB**********************************@microsof t.com... on the Child,
this is the html :
<input type="submit" name="_ctl0:ContentPlaceHolder1:Button1" value="Button" onclick="SetValue();if (typeof(Page_ClientValidate) == 'function') { if (Page_ClientValidate() == false) { return false; }} this.value = 'Please wait...';this.disabled = true;__doPostBack('_ctl0:ContentPlaceHolder1:Butto n1','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("_ctl0:ContentPlaceHolder1 :Button1", "", true, "", "", false, false))" language="javascript" id="_ctl0_ContentPlaceHolder1_Button1" />
all the code is on the child, and i've tried page load, page int, page int comp, all of them are giving me the same error.
I have this code on the preload event
// Button1.Attributes.Add("onclick", "document.aspnetForm." + Button1.ClientID + ".value = 'Please wait.'");
this works but this isn't what I need.
Thanks
Andre "clickon" wrote:
Where is the btnSubmit control child or master page, is it inseide any other controls;
Where is the code, Child or master page, what event handler is it in or called from.
"André" wrote:
> Hi, > > I am using this code to prevent multi click asp.net 2.0 c#, > > System.Text.StringBuilder sb = new System.Text.StringBuilder(); > sb.Append("SetValue();"); > sb.Append("if (typeof(Page_ClientValidate) == 'function') > { "); > sb.Append("if (Page_ClientValidate() == false) { return > false; > }} "); > sb.Append("this.value = 'Please wait...';"); > sb.Append("this.disabled = true;"); > > sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit)); > sb.Append(";"); > > this.btnSubmit.Attributes.Add("onclick", sb.ToString()); > > When I add this code to a page using a masterpage i get an error, > "Objected > Expected" > > I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but > nothing works. > > Thanks > > Andre
anyone have any ideas?
"André" wrote: I have reg expression validators on there, if it fails to validate, then the button is locked.
The code I have below works if it's not on a master page. I want/need to understand why it's not working more so then anything else.
Thanks
Andre
"Jeff Dillon" wrote:
You should disable the submit button clientside on the first click
"André" <An**@discussions.microsoft.com> wrote in message news:EB**********************************@microsof t.com... on the Child,
this is the html :
<input type="submit" name="_ctl0:ContentPlaceHolder1:Button1" value="Button" onclick="SetValue();if (typeof(Page_ClientValidate) == 'function') { if (Page_ClientValidate() == false) { return false; }} this.value = 'Please wait...';this.disabled = true;__doPostBack('_ctl0:ContentPlaceHolder1:Butto n1','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("_ctl0:ContentPlaceHolder1 :Button1", "", true, "", "", false, false))" language="javascript" id="_ctl0_ContentPlaceHolder1_Button1" />
all the code is on the child, and i've tried page load, page int, page int comp, all of them are giving me the same error.
I have this code on the preload event
// Button1.Attributes.Add("onclick", "document.aspnetForm." + Button1.ClientID + ".value = 'Please wait.'");
this works but this isn't what I need.
Thanks
Andre "clickon" wrote:
> Where is the btnSubmit control child or master page, is it inseide any > other > controls; > > Where is the code, Child or master page, what event handler is it in or > called from. > > "André" wrote: > > > Hi, > > > > I am using this code to prevent multi click asp.net 2.0 c#, > > > > System.Text.StringBuilder sb = new System.Text.StringBuilder(); > > sb.Append("SetValue();"); > > sb.Append("if (typeof(Page_ClientValidate) == 'function') > > { "); > > sb.Append("if (Page_ClientValidate() == false) { return > > false; > > }} "); > > sb.Append("this.value = 'Please wait...';"); > > sb.Append("this.disabled = true;"); > > > > sb.Append(this.Page.GetPostBackEventReference(this .btnSubmit)); > > sb.Append(";"); > > > > this.btnSubmit.Attributes.Add("onclick", sb.ToString()); > > > > When I add this code to a page using a masterpage i get an error, > > "Objected > > Expected" > > > > I tried changing "this.disable" to btnSubmit.ClientID + ".disable" but > > nothing works. > > > > Thanks > > > > Andre This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: NotGiven |
last post by:
Say you have three pages, a search page, a results/master, and a detail
page.
You choose parameters on your search page and submit the page.
The results show in the reults/master page.
You...
|
by: Job Lot |
last post by:
How can I prevent multiple instances of MdiChild form? I have a MdiParent
form with a DataGrid showing all the clients in the database. User clicks on
a row to open MdiChild form which display...
|
by: James Radke |
last post by:
Hello,
I have a multithreaded windows NT service application (vb.net 2003) that I
am working on (my first one), which reads a message queue and creates
multiple threads to perform the processing...
|
by: EagleRed |
last post by:
I am writing an ASP.NET 2.0 application that uses more than one master page.
Currently, there are two pages, Freedom1.master and Freedom2.master. I have
no problems with Freedom1.master. However,...
|
by: lushgrass |
last post by:
this is a .net 2003 c# windows form project.
there is a menu button called "search"
it does a lot of stuff and takes some time. i need to prevent the form from allowing the user to click on it...
|
by: Rich |
last post by:
Hi,
I want to use 2 master pages, one for the main part of the site, the other
for the admin pages.
They are quite similar, with many shared elements.
Ideally I would like to have a parent...
|
by: Greg |
last post by:
I have a complex page (with 8 complex user controls, and many other
asp.net controls.) I have 2 very similiar pages to create, each page
differing only from the others in one control.
What is...
|
by: MikeB |
last post by:
Hello,
I have a content page that is from a Master page which has 2 content panes.
How do I add my forms to the content page? Each pane needs a form but you
can not have multiple form tags nor...
|
by: helveticus |
last post by:
I have a master/details configuration that includes multiple user
controls. The details page is configured to cache data via
VaryByCustom. This works fine.
One of the user controls contains an...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
| |