Calling __doPostBack()
-
How to trigger postback for a javascript
// function Button1_onclick() { document.forms[0]['fileBrowse'].click(); document.forms[0]['TextBox1'].value = document.forms[0]['fileBrowse'].value; __doPostBack( 'TextBox1',''); } //
this code showing an error "object expected" while debugging javascript :confused: Regards, Radhakrishnan -
How to trigger postback for a javascript
// function Button1_onclick() { document.forms[0]['fileBrowse'].click(); document.forms[0]['TextBox1'].value = document.forms[0]['fileBrowse'].value; __doPostBack( 'TextBox1',''); } //
this code showing an error "object expected" while debugging javascript :confused: Regards, RadhakrishnanHi, i'm not sure, but maybe you have to use
document.getElementById()
and the onclick doesn't seem correct:
onclick="javascript:Button1_onclick();"
Do you get the error on your server or on the client? Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
Hi, i'm not sure, but maybe you have to use
document.getElementById()
and the onclick doesn't seem correct:
onclick="javascript:Button1_onclick();"
Do you get the error on your server or on the client? Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
Error at client side on that __doPostBack()
-
Error at client side on that __doPostBack()
You can use the Firefox error console to get the line and a detailed error message.
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
How to trigger postback for a javascript
// function Button1_onclick() { document.forms[0]['fileBrowse'].click(); document.forms[0]['TextBox1'].value = document.forms[0]['fileBrowse'].value; __doPostBack( 'TextBox1',''); } //
this code showing an error "object expected" while debugging javascript :confused: Regards, Radhakrishnandocument.getelementbyid('yourButtonId').click();
I didn't get any requirements for the signature
-
document.getelementbyid('yourButtonId').click();
I didn't get any requirements for the signature
Error is at line __doPostBack( 'TextBox1',''); "object expected"
-
Error is at line __doPostBack( 'TextBox1',''); "object expected"
That's not what I meant. Drag a button onto your form. Double click the button in design view to generate server side method. Add the following in the page_load (server side code) this.Button1.Style.Add("display", "none"); Add the following javascript to your page. function CallServerMethod() { var Button1 = document.getElementById("<%=Button1.ClientID %>"); Button1.click(); } In your javascript replace __doPostBack( 'TextBox1',''); with CallServerMethod() Add server side code to Button1_Click() event
I didn't get any requirements for the signature