In my project i am using Textbox inside updatepanel to display the Receipt number which is not already exist in db table. But the textchanged event on the textbox is no
You can create a procedure in serverside and execute it with javascript. The logic used below is simple, create a procedure, add a button and set visibility to false or display: none with css. The procedure is then fired on click of the button, and the click event is being triggered from the javascript. Feel free to ask if you encounter any problem
vb code
Public Sub FetchRecord()
'Your Code Here..
End Sub
Protected Sub btnView_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnView.Click
FetchRecord()
End Sub
Javascript
<script type="text/javascript">
function Filter() {
document.getElementById('<%= btnView.ClientID %>').click()
}
</script>
Use this, its working fine
JAVASCRIPT
function ChangeText() {
var t1 = document.getElementById('<%= txtArticleTitle.ClientID %>');
var t2 = document.getElementById('<%= txtPageName.ClientID %>');
t2.value = t1.value;
}
ASP.NET SOURCE
Article Title:
<asp:TextBox ID="txtArticleTitle" runat="server" onkeyup="ChangeText()" Width="600px"></asp:TextBox>
<br />
Page Name:
<asp:TextBox ID="txtPageName" runat="server" Width="600px"></asp:TextBox>
two notes.
Textchanged fires when the text box loses focus. You can use the keyd own or keypress events instead.
Calling the server every time a user presses a key is not recommended. Consider using a timeout so you call the server only when the user finished typing (350 milliseconds is the standard I think) or pre load a list from the server and filter it client side.
P.S.
Do not use ASP.Net ajax... Just saying.