JavaScript Fire Serverside event from javascript fire server side event from javascript asp.net,fire server

i have hiddentfield whose value is changing on javascript.

I just wanted to fire serverside event valuechanged event of hiddenfield when its value changed from javascript.

I tried with :

__doPostBack('hfLatitude', 'ValueChanged');

But giving me error :

Microsoft JScript runtime error: '__doPostBack' is undefined

Is there any other alternative for this?

Please help me.

Answer:1

Quick and Dirty:

Simply put a asp button on form. Set it display:none.

<asp:Button id="xyx" runat="server" style="display:none" OnClick="xyx_Click" />

On its click event call any server side event.

protected void xyx_Click(o,e)
{
   //you server side statements
}

To call its from JS use as below:

<script>

function myserverside_call()
{
var o = document.getElementById('<%=xyx.ClientID%>');
o.click();
}

function anyotherjsfunc()
{
   //some statements
   myserverside_call();
}
</script>
Answer:2

I want to add a custom attribute for each object in my canvas. I did that using: fabric.Object.prototype.toObject = (function (toObject) { return function () { return fabric.util.object....

I want to add a custom attribute for each object in my canvas. I did that using: fabric.Object.prototype.toObject = (function (toObject) { return function () { return fabric.util.object....

  1. fabricjs custom attributes
  2. fabricjs add custom attributes

I want to delete * characters if it is present in a string. This is my code but it's not working. String.replace(/*/g '')

I want to delete * characters if it is present in a string. This is my code but it's not working. String.replace(/*/g '')

  1. replace characters string python
  2. replace characters string javascript
  3. replace characters string c#
  4. replace characters string java
  5. replace characters string matlab
  6. replace characters string powershell
  7. replace characters string vba
  8. replace characters string array java
  9. replace string characters
  10. replace string characters in r
  11. replace string characters php
  12. replace string characters swift
  13. replace string characters in stata
  14. replace string characters ruby
  15. replace string characters sed
  16. replace characters in string bash
  17. replace characters in string sql
  18. replace characters in string js
  19. replace characters in string online
  20. replace all characters string javascript

I want to prevent input focus onclick and focus inputs on double click. Something like.... $('input').click(function) { $(this)preventFocus(); }); $('input').dblclick(function) { $(this)...

I want to prevent input focus onclick and focus inputs on double click. Something like.... $('input').click(function) { $(this)preventFocus(); }); $('input').dblclick(function) { $(this)...

  1. input focus double click

I have an animation when my checkboxes are checked, but I want to reverse the animation when they are unchecked. I tried the pseudo class :unchecked, which I found did not work. Is there a CSS3 ...

I have an animation when my checkboxes are checked, but I want to reverse the animation when they are unchecked. I tried the pseudo class :unchecked, which I found did not work. Is there a CSS3 ...

  1. uncheck checkbox css