Hi, I'm wondering how I can generate a postback using javascript on a page
that does not have any controls with the auto-postback property set to true.
I know I can just use the submit() function but this triggers page
validation which I do not want. What I'm trying to do is dynamically write
in a hyperlink that when clicked will remove an item from the form, so I
don't want any validation to occur because the form isn't being submitted at
that point. And because there are no auto-postback controls the server does
not write in the javascript which would be used to effect the postback so I
can't just insert "onclick("__doPostBack('','');")". Is there an easy way to
do this without manually inserting a bunch of javascript code? More
concisely... How do I manually effect a postback without triggering page
validation?
Thanks!
Richard 5 2575
Although there is a way to do postback without manually inserting all the
javascript, why not just use a linkbutton (hence all javascript is written
for you) and simply set it's CausesValidation to false?
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Psych971" <de*********@hotmail.com> wrote in message
news:_f****************@newsread3.news.pas.earthli nk.net... Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to
true. I know I can just use the submit() function but this triggers page validation which I do not want. What I'm trying to do is dynamically write in a hyperlink that when clicked will remove an item from the form, so I don't want any validation to occur because the form isn't being submitted
at that point. And because there are no auto-postback controls the server
does not write in the javascript which would be used to effect the postback so
I can't just insert "onclick("__doPostBack('','');")". Is there an easy way
to do this without manually inserting a bunch of javascript code? More concisely... How do I manually effect a postback without triggering page validation?
Thanks! Richard
Because I'm writing dynamically into the response file i don't think you can
insert asp controls, can you?
thanks,
richard
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Ol**************@TK2MSFTNGP15.phx.gbl... Although there is a way to do postback without manually inserting all the javascript, why not just use a linkbutton (hence all javascript is written for you) and simply set it's CausesValidation to false?
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Psych971" <de*********@hotmail.com> wrote in message news:_f****************@newsread3.news.pas.earthli nk.net... Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function but this triggers page validation which I do not want. What I'm trying to do is dynamically write in a hyperlink that when clicked will remove an item from the form, so I don't want any validation to occur because the form isn't being submitted at that point. And because there are no auto-postback controls the server does not write in the javascript which would be used to effect the postback so I can't just insert "onclick("__doPostBack('','');")". Is there an easy way to do this without manually inserting a bunch of javascript code? More concisely... How do I manually effect a postback without triggering page validation?
Thanks! Richard
Are you dynamically creating it via
LinkButton lb = new LinkButton()
someControl.Controls.Add(lb);
or are you actually writing it to the html/aspx file via a streamwriter or
something? If it's the first one, don't see why you can't add
causesValidatation = false...if its the second case (god why?) then you are
in trouble...
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"Psych971" <de*********@hotmail.com> wrote in message
news:0Q****************@newsread1.news.pas.earthli nk.net... Because I'm writing dynamically into the response file i don't think you
can insert asp controls, can you?
thanks, richard
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:Ol**************@TK2MSFTNGP15.phx.gbl... Although there is a way to do postback without manually inserting all
the javascript, why not just use a linkbutton (hence all javascript is
written for you) and simply set it's CausesValidation to false?
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Psych971" <de*********@hotmail.com> wrote in message news:_f****************@newsread3.news.pas.earthli nk.net... Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function but this triggers page validation which I do not want. What I'm trying to do is dynamically write in a hyperlink that when clicked will remove an item from the form, so
I don't want any validation to occur because the form isn't being
submitted at that point. And because there are no auto-postback controls the server does not write in the javascript which would be used to effect the postback
so I can't just insert "onclick("__doPostBack('','');")". Is there an easy
way to do this without manually inserting a bunch of javascript code? More concisely... How do I manually effect a postback without triggering
page validation?
Thanks! Richard
You've shown me the light! I was doing it the second way but it my first
..net page so what'd you expect? :) Will switch to LinkButton.. thanks so
much! ASP.NET rules!!
peace out,
richard
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Op**************@TK2MSFTNGP15.phx.gbl... Are you dynamically creating it via
LinkButton lb = new LinkButton() someControl.Controls.Add(lb);
or are you actually writing it to the html/aspx file via a streamwriter or something? If it's the first one, don't see why you can't add causesValidatation = false...if its the second case (god why?) then you are in trouble...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"Psych971" <de*********@hotmail.com> wrote in message news:0Q****************@newsread1.news.pas.earthli nk.net... Because I'm writing dynamically into the response file i don't think you can insert asp controls, can you?
thanks, richard
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:Ol**************@TK2MSFTNGP15.phx.gbl... > Although there is a way to do postback without manually inserting all the > javascript, why not just use a linkbutton (hence all javascript is written > for you) and simply set it's CausesValidation to false? > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Psych971" <de*********@hotmail.com> wrote in message > news:_f****************@newsread3.news.pas.earthli nk.net... >> Hi, I'm wondering how I can generate a postback using javascript on a >> page >> that does not have any controls with the auto-postback property set to > true. >> I know I can just use the submit() function but this triggers page >> validation which I do not want. What I'm trying to do is dynamically >> write >> in a hyperlink that when clicked will remove an item from the form, so I >> don't want any validation to occur because the form isn't being submitted > at >> that point. And because there are no auto-postback controls the server > does >> not write in the javascript which would be used to effect the postback so > I >> can't just insert "onclick("__doPostBack('','');")". Is there an easy way > to >> do this without manually inserting a bunch of javascript code? More >> concisely... How do I manually effect a postback without triggering page >> validation? >> >> Thanks! >> Richard >> >> > >
I just wrote a control to do this. basically it registers a javascript
function doPostBack(arg), that client code can call. I added a standard
server event handling, so the client can call a know routine.
string script = "<script language=\"JavaScript\">function
doPostBack(a,v,fn){__doPostBack('"
+ this.UniqueID + "',a,v,fn);}</script>\n";
if(!this.Page.IsClientScriptBlockRegistered("doPos tBack"))
this.Page.RegisterClientScriptBlock("doPostBack",s cript);
Page.GetPostBackEventReference(this);
the trick is, Page.GetPostBackEventReference(this), this call is what
triggers .net generating the autopostback code.
-- bruce (sqlwork.com)
"Psych971" <de*********@hotmail.com> wrote in message
news:_f****************@newsread3.news.pas.earthli nk.net...
| Hi, I'm wondering how I can generate a postback using javascript on a page
| that does not have any controls with the auto-postback property set to
true.
| I know I can just use the submit() function but this triggers page
| validation which I do not want. What I'm trying to do is dynamically write
| in a hyperlink that when clicked will remove an item from the form, so I
| don't want any validation to occur because the form isn't being submitted
at
| that point. And because there are no auto-postback controls the server
does
| not write in the javascript which would be used to effect the postback so
I
| can't just insert "onclick("__doPostBack('','');")". Is there an easy way
to
| do this without manually inserting a bunch of javascript code? More
| concisely... How do I manually effect a postback without triggering page
| validation?
|
| Thanks!
| Richard
|
| This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: francois |
last post by:
I have a ASPX form with a dropdownlist that makes a post back (to the same
page of course, just a normal asp.net postback)
That page also has an auto refresh javascript as it needs to refresh its...
|
by: Krista Lemieux |
last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with
this technology. I've been told that when I have a control, I should
only bind the data to it once, and not on each post back...
|
by: RAJ |
last post by:
In our multi-tier application, we have several ASP.NET user controls which
will update the same data source provided by middle tier logic.
In this particular scenario we have one user control...
|
by: Antoine |
last post by:
Forgive me as a beginner in asp.net. I wanted to ask some simple but clear
questions, at least I hope they are.
Ive seen a control in asp.net that works with codebehind and the good thing
about...
|
by: Achim Domma (SyynX Solutions GmbH) |
last post by:
Hi,
in my application I suddenly get the error:
"An error has occurred because a control with auto-generated id
'main:institutionManagement:institutionOverview' could not be located to
raise...
|
by: Larry |
last post by:
Is there a way to disable all the controls the instant any auto-postback
controls are changed (resulting in a postback that takes a couple seconds),
so that the user can't continue changing other...
|
by: keithb |
last post by:
I posted this question earlier with an unclear predicate. Let me give it
another shot:
I have found that unless I re-create dynamically added controls on every
postback, I am unable to access...
|
by: John Kotuby |
last post by:
Hi guys,
I am converting a rather complicated database driven Web application from
classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The
original ASP application works quite...
|
by: =?Utf-8?B?V2VzbGV5IERhdmlzLCBHZW5lcmFsIER5bmFtaWNz |
last post by:
I'm moving from years with the datagrid to a new project, .net 2.0, using
GridView controls. Per past practice, it is often a lot easier to inject
controls (or special formatting) in RowDataBound...
|
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: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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...
|
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,...
|
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: 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,...
|
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...
| |